// set our max value for maximum percentage discounts
$payload['maxValue'
] = '';
if ($discount->
getType() === PromotionDiscountEntity::TYPE_PERCENTAGE &&
$discount->
getMaxValue() !== null
) { $payload['maxValue'
] =
(string) $this->
getCurrencySpecificValue($discount,
$discount->
getMaxValue(),
$currencyId,
$currencyFactor);
} // set the scope of the discount cart, delivery....
$payload['discountScope'
] =
$discount->
getScope();
// 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;
}