tastyigniter/ti-ext-coupons

Coupons do NOT get applied on options

Closed this issue · 4 comments

Expected Behaviour
Once a discount coupon is applied, it should apply to the options as well.
Actual behaviour
After applying a discount restricted to only some products, the discount is applied to the menu items but not to any paid options.

Reproduce steps
Create a new coupon that applies a 10% discount to a limited number of items
immagine
immagine

Create an order by selecting one or more products to which the coupon can be applied.
As you can see, each product costs 2 euros as a base plus 2 euros as an addition; having selected 6, we are talking about 24 in total
immagine

By applying the coupon, a discount of 1.20 euros is applied; this is because the discount is applied only on the base price of the product (6 products of 2 euros, i.e. 12), and not on additions (which keep their price unchanged)
Below is an example of how the discount works
immagine

Additional informations
This does not seem to happen instead with discounts that apply to the entire cart without exception
Version
v.3.0.4-beta.25.2

@sampoyigi I tried to look into this but cant figure out where the cartItem price is being calculated from...

See CartItem::price and CartItem::subtotal

Thanks @ryanmitchell. Fixed!