getSetGroupId 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'][] = [
                    'groupId' => $group->getId(),
                    
Home | Imprint | This part of the site doesn't use cookies.