@medusajs/promotion

2.21.2

Patch Changes

2.21.1

Patch Changes

2.21.0

Patch Changes

A buyget promotion whose target product is also listed in its own buy_rules was applied or not depending purely on the order of line items in the cart, and when it was not applied nothing surfaced — no error, no adjustment, the cart silently stayed at full price.

Two things caused it. sortByPrice in buy-get.ts never returned 0, so for equally priced items it claimed a strict ordering that does not exist and left the result up to the sort implementation. The buy-side selection then greedily reserved the first buy_rules_min_quantity eligible items and subtracted them from the target's available quantity, so whenever the target item was the one reserved, the promotion was dropped even though a valid assignment existed.

The comparators now return 0 for equal prices (also in sort-by-price.ts, where sortLineItemByPriceAscending and sortShippingLineByPriceAscending had the same problem), and the buy side now prefers items that cannot serve as targets before falling back to target-eligible ones. Buy X get X on a single product is unaffected.

2.20.1

Patch Changes

2.20.0

Patch Changes

2.19.0

Patch Changes

2.18.0

Patch Changes

2.17.2

Patch Changes

2.17.1

Patch Changes

2.17.0

Patch Changes

2.16.0

Patch Changes

The applied-promotions accumulator stored adjustment amounts in each promotion's own tax base, so a tax-inclusive promotion compared its remaining applicable amount (incl-tax) against amounts a previous non-tax-inclusive promotion recorded excl-tax. The mismatched bases let the combined discount exceed the line item value and drive the taxable base negative. Applied amounts are now tracked tax-exclusively and converted to the promotion's base before being subtracted, for both each and across allocations.

2.15.5

Patch Changes

2.15.4

Patch Changes

2.15.3

Patch Changes

2.15.2

Patch Changes

2.15.1

Patch Changes

2.15.0

Patch Changes

2.14.2

Patch Changes

2.14.1

Patch Changes

2.14.0

Patch Changes

2.13.6

Patch Changes

2.13.5

Patch Changes

2.13.4

Patch Changes

2.13.3

Patch Changes

2.13.2

Patch Changes

2.13.1

Patch Changes

2.13.0

Minor Changes

Patch Changes

2.12.6

Patch Changes

2.12.5

Patch Changes

2.12.4

Patch Changes

2.12.3

Patch Changes

2.12.2

Patch Changes

2.12.1

Patch Changes

2.12.0

Patch Changes

2.11.3

Patch Changes

2.11.2

Patch Changes

2.11.1

Patch Changes

2.11.0

Patch Changes

2.10.3

Patch Changes

2.10.2

Patch Changes

2.10.1

Patch Changes

2.10.0

Patch Changes

2.9.0

Patch Changes

2.8.8

Patch Changes

2.8.7

Patch Changes

2.8.6

Patch Changes

2.8.5

Patch Changes

2.8.4

Patch Changes

2.8.3

Patch Changes

2.8.2

Patch Changes

2.8.1

Patch Changes

2.8.0

Patch Changes

2.7.1

Patch Changes

2.7.0

Patch Changes

2.6.1

Patch Changes

2.6.0

2.5.1

2.5.0

Patch Changes

2.4.0

Minor Changes

Patch Changes

2.3.1

2.3.0

Patch Changes

2.2.0

Patch Changes

2.1.3

2.1.2

Patch Changes

2.1.1

Patch Changes

2.1.0

2.0.7

2.0.6

2.0.5

Patch Changes

2.0.4

2.0.3

2.0.2

2.0.1

2.0.0

Major Changes

Patch Changes

0.0.4

Patch Changes

0.0.3

Patch Changes

0.0.2

Patch Changes