You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using promotion with Item percentage discount or Item fixed discount actions, then adjustments are applied on AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT (or ORDER_UNIT_PROMOTION_ADJUSTMENT, didn't check) level.
In such case CartView
"cartDiscounts": []
is empty, while totals->promotion is correctly filled.
(Do ignore non-standard output, this is artifact of my project)
/** * Returns amount of order discount. Does not include shipping discounts. */publicfunctiongetOrderPromotionTotal(): int
{
return$this->getAdjustmentsTotalRecursively(AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT) +
$this->getAdjustmentsTotalRecursively(AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT) +
$this->getAdjustmentsTotalRecursively(AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT)
;
}
When using promotion with
Item percentage discount
orItem fixed discount
actions, then adjustments are applied onAdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT
(orORDER_UNIT_PROMOTION_ADJUSTMENT
, didn't check) level.In such case
CartView
is empty, while
totals->promotion
is correctly filled.(Do ignore non-standard output, this is artifact of my project)
Problem is with mismatch between adjustments levels for those properties.
Totals->promotion
usesShopApiPlugin/src/Factory/Cart/TotalViewFactory.php
Line 26 in 8fe5f49
which works by all three adjustment levels
and
cartDiscounts
only checks for order levelShopApiPlugin/src/Factory/Cart/CartViewFactory.php
Line 85 in 8fe5f49
I'm going to fix this in my project and see how it will go, but so far it looks like an error, rather than design decision.
The text was updated successfully, but these errors were encountered: