I have an problem retrieving specific discount information for an item of ordered with multiple qty.
Here's the scenario.
- An item with a price of $100.
- A shopping cart price rule of $10 off that item, limited to a quantity of 2.
- An order with a qty of 3 for the item (with the above rule applied).
For the order data, the item appears on one row like this:
- Original Price: $100
- Qty: 3 Subtotal: $300
- Discount Amount: $20
- Row Total: $280
Is there any way to retrieve the total quantity of items that the rule was applied to. In this case, it would be 2 (since the rule was limited to qty of 2). I know that Magento stores the applied_rule_ids
, however using this cannot be a reliable way of retrieving the discount data applied to individual items because the Shopping Cart Price rules can be modified after the order has been placed.
It seems like Magento doesn't tell you where exactly discounts are being applied on the quantity level. It just groups multiple quantities into a single row and tells you overall how much was discounted.
Is it possible to retrieve that one item like this:
- Name: Item Name | Discount Amount: $10 (discount applied)
- Name: Item Name | Discount Amount: $10 (discount applied)
- Name: Item Name | Discount Amount: 0 (discount NOT applied)
Instead of how it is now:
- Name: Item Name | Discount Amount: $20 (discount applied to 2 out of 3)