Coupon fixed amount

Hello,

i have trouble with a simple cart-store (newest version of simplecard) and a fixed amount coupon. When i add a percent coupon everything inside the cart works fine. But when i add an fixed amount coupon the price calculation gets messed up:
Instead of just calculating the total price minus the discount, simplecart multiplies the amount of discount with the quantity of items. So the fixed amount works on one item in the cart. But if i have more than one item in the cart the fixed amount gets multiplied by the number of items in the cart. For example:

  • 1 Item cost 10 EUR and i have a discount of 10 EUR: the total is 0 EUR
  • 10 Items cost 100 EUR and i have a discount of 10 EUR: the total is still 0 EUR not 90 EUR

I found in line 1433 in “Cart.class.php” may the reason:

$totalDiscount = $priceDiscount['price'] * $products[$optKey]->totals['quantity'];

and changed it to:

$totalDiscount = $priceDiscount['price'];

That fixed the problem for the quantity. But when i have 2 different items in the cart the discount still gets multiplied by the amount of items.

Can someone help me to fix this issue?

Thank you very much.

nice regards
Jan

Hi Jan,

That’s a known issue that I’ve been planning to solve in 2.4. I think it’ll take a bit more work to sort that out in a way that the percentage based discount still works properly as well…

Hi Mark,

thanks a lot for your quick support. I just thought i may get it to work for “fixed amounts” only, because the client only wants to create that fixed amount coupons.
It is good to hear that this probably gets fixed in the next version. Than we just have to wait for that.

Thanks a lot.

nice regards,
Jan