if ($promotion->
isUseIndividualCodes()) { $promotionCodeType = 'individual';
} if ($code === ''
) { $promotionCodeType = 'global';
} $payload['promotionCodeType'
] =
$promotionCodeType;
// 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