isScopeSetGroup example

// specifies if the promotion is not combinable with any other promotion         $payload['preventCombination'] = $promotion->isPreventCombination();

        // If all combinations are prevented the exclusions dont matter         // otherwise sets a list of excluded promotion ids         $payload['exclusions'] = $payload['preventCombination'] ? [] : $promotion->getExclusionIds();

        $payload['groupId'] = '';
        // if we have set a custom setgroup scope, then the group id         // is used as suffix in the scopeKey...         if ($discount->isScopeSetGroup()) {
            $payload['groupId'] = $discount->getSetGroupId();
            $payload['discountScope'] = PromotionDiscountEntity::SCOPE_SETGROUP;
        }

        // add all our set groups to our configuration         // if existing. always make sure to have at least a node         $payload['setGroups'] = [];

        if ($promotion->getSetgroups() !== null) {
            foreach ($promotion->getSetgroups() as $group) {
                $payload['setGroups'][] = [
                    
$prefix = PromotionDiscountEntity::SCOPE_SETGROUP . '-';

        return mb_strpos($this->scope, $prefix) === 0;
    }

    /** * Gets the assigned groupId if * the discount scope has been set to setgroup. */
    public function getSetGroupId(): string
    {
        if (!$this->isScopeSetGroup()) {
            return '';
        }

        $prefix = PromotionDiscountEntity::SCOPE_SETGROUP . '-';

        return str_replace($prefix, '', $this->scope);
    }

    public function getSorterKey(): string
    {
        if ($this->sorterKey === null) {
            
Home | Imprint | This part of the site doesn't use cookies.