VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: reinhold on December 21, 2012, 01:13:30 AM

Title: [PATCH] Coupon discount is displayed without '-' in the cart
Post by: reinhold on December 21, 2012, 01:13:30 AM
If you have a coupon discount in the cart, the amount will be displayed without a leading minus sign, making it look like the amount is added rather than subtracted from the total.
Attached is a patch (for svn trunk) that creates the displayed coupon discount from the negative value. (Additionally, the invoice view prepended the string '- ', which will break if you have negative coupons, like an extra donation you can make to a charity by giving a particular coupon code. So the patch changed this to displaying the negative amount.)

The only thing I don't like about my patch is the explicit "-" prepended to the coupon description. It might not be strictly necessary, but IMO it looks better to have "String trio (-20%)" rather than "String trio (20%)", since the latter might not indicate it's a discount and not an additional fee.

Cheers,
Reinhold


[attachment cleanup by admin]
Title: Re: [PATCH] Coupon discount is displayed without '-' in the cart
Post by: Bigitybossman on May 23, 2013, 07:25:35 AM
Thanks Reinhold for your help.

I didn't use the file completely, but i did take bits of it and it solved the problem for me.

Cheers