- Issue created by @facine
- Merge request !337Issue #3474801: Multiple BuyXGetY promotions with the same gift product are... → (Open) created by facine
- 🇪🇸Spain facine
It seems that the unit price is reset the second time the promotion is applied due to the issue at this line: https://git.drupalcode.org/project/commerce/-/blob/3.0.x/modules/promoti....
For now, as a workaround, I recalculate the unit price in the `buildAdjustmentAmount` method before calculating the new adjustment.
protected function buildAdjustmentAmount(OrderItemInterface $order_item, $quantity) { if ($this->configuration['offer_type'] == 'percentage') { $percentage = (string) $this->configuration['offer_percentage']; $adjusted_total_price = $order_item->getTotalPrice(); foreach ($order_item->getAdjustments(['promotion']) as $adjustment) { if ($adjustment->isIncluded()) { $adjusted_total_price = $adjusted_total_price->add($adjustment->getAmount()); } }
- 🇮🇱Israel jsacksick
I don't consider this a "critical" bug report TBH (per https://www.drupal.org/docs/develop/issues/fields-and-other-parts-of-an-... → ).