Discounts not applied in e-mail templates?
leafish_paul - October 3, 2008 - 16:19
| Project: | quantity_discount |
| Version: | 5.x-0.1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
The token [txn-items] used in, for example, the Default customer invoice template doesn't seem to have any discounts from this module applied.
Could anyone point me in the right direction as to how to fix this, either by quantity_discount module altering the token, or $txn object?

#1
I've hopefully sorted this by providing a new token, [txn-items-discounted] to include discounted price information. I am unsure whether this is the best way (or whether the quantity_discount module should affect the current [txn-items] token).
I'm also repeating the discount logic from lines ~532-560 inside the new quantity_discount_token_values(), so perhaps some of this could be refactored out of quantity_discount_product_specials() into its own function.
I can tidy things up a bit and post some code if anyone's interested.
#2
Please post whatever code you have! =) I'll try to incorporate it asap to the new 5.x-1.x branch