Problem/Motivation

groupAdjustments() used a dead $order_data variable in its isset() check, so it
was never populated and every adjustment simply overwrote the previous one of
the same type. When an order item carried more than one adjustment of a type
(e.g. two stacked promotions), the grouped "total" kept only the last one.

The per-item split then subtracted the share of *all* same-type adjustments from
that understated total, driving the running remainder negative, and the
last-item reconciliation folded that bogus remainder into the final bundle
component — producing a discount larger than the component's own price.

Fix: accumulate into $adjustments_amounts directly. Also fold the last-item
rounding remainder into a single adjustment per type (break) so it is not
multiplied across several same-type adjustments.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

valic created an issue. See original summary.

valic’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.