Refunding one item from a promotion starts with order and invoice data, not today’s banner. Quantity Boost records discount and audit fields. The previous guide tests promotional calculation; here we distinguish credit memo amounts from the discount trail using module 1.0.16 and Magento 2.4.8 reference source.
Read historical amounts rather than the current promotion
Record order item ID, SKU, ordered and invoiced quantities, invoiced discount, and quantities and discounts already refunded. Compare like currencies, keeping base and displayed amounts separate. A Quantity Boost threshold changed after purchase cannot reconstruct the historical calculation from today’s cart.
Quantity Boost discount is included in the item’s standard discount amount; quantity_boost_discount_amount and base_quantity_boost_discount_amount record its audit component. Do not subtract that component twice. Rule IDs help identify the source but replace neither saved amounts nor the full history of promotional conditions.
Calculate a simple example with explicit assumptions
Technical example: one simple-product line, two units priced at 100 each, with only a Quantity Boost discount of 20 across the line. Both units are invoiced and nothing has previously been refunded. Assume one currency and no tax, shipping or extra adjustments. These are fictional values illustrating a proportion, not a shop order result.
| Measure | Value |
|---|---|
| Ordered quantity | 2 |
| Item Quantity Boost discount | 20 |
| Credit memo quantity | 1 |
| Credit memo Quantity Boost audit | 10 |
For one unit being refunded, the native 2.4.8 discount calculator under these assumptions allocates 20 across 2: credit memo discount is 10 and the goods component is 100 − 10 = 90. Separately, the module observer records audit value 20 × 1/2 = 10. These describe the same discount component, not two deductions. Audit value 10 alone is not the refund amount.
Check what the credit memo observer actually records
CreditmemoRegister transfers the audit amount in proportion to credit memo quantity against ordered quantity and copies rule IDs. This method neither changes grand_total nor initiates payment. For the same order line with quantity 2, it does not persist separate “first full-price” and “second discounted” identities for choosing a physical unit at return time.
Native credit memo discount calculation uses invoiced data, previous refunds and remaining quantity; the final memo may allocate the discount remainder after rounding. The module audit uses a different, simple ordered-quantity proportion. With partial invoices, multiple memos or different SKUs, do not automatically reuse the example’s 90 result.
Separate document calculation from executing a refund
Adobe explains Qty to Refund, shipping and Adjustment fields. Check every component and previous memos before approval. Extra adjustment fields do not automatically recalculate promotional terms after a return; changes need established rules and separate approval. The overlapping-discount check helps identify beforehand whether item discount also includes other promotions.
Online versus offline depends on payment and invoice; an offline credit memo entry alone does not request a payment-provider refund. Test with synthetic data and the appropriate payment environment. Here we reviewed code and example arithmetic without creating a credit memo, refunding money or changing an order. This article explains technical records, not the policy determining a customer’s promotional refund entitlement.
