- Issue created by @Anybody
- 🇮🇱Israel jsacksick
All promotions are applied / distributed to order items. There is no order level promotion per say.
$order->getAdjustments()
would return order level adjustments (so none in case of promotions). The main difference lies in the fact that the adjustment is included or not... - 🇩🇪Germany Anybody Porta Westfalica
Thank you very much for the immediate feedback @jsacksick - and sorry, from the naming and method description I would have expected that differently.
To help others: So you always need to use
$order->collectAdjustments(['promotion']);
as
$order->getAdjustments(['promotion']);
will never return a result by design.Afterwards you can use
$promitionAdjustment->isIncluded()
to check, if the adjustment is already included, for the cases described above.Right?
Thank you once again!!
- 🇮🇱Israel jsacksick
Either that or you could load the promotion using the adjustment source ID, and then do different logic based on the promotion offer plugin.
- 🇩🇪Germany Anybody Porta Westfalica
Either that or you could load the promotion using the adjustment source ID, and then do different logic based on the promotion offer plugin.
Thanks yes - but isn't using the adjustment source ID always risky, as the referred promotion may have changed in the meantime? (e.g. someone changed the discount from 10% to 5%)
Automatically closed - issue fixed for 2 weeks with no activity.