VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: holanpan7 on December 11, 2019, 12:23:25 PM

Title: strikesthrough prices in cart
Post by: holanpan7 on December 11, 2019, 12:23:25 PM
Hello,

I am using joomla! 3.9.13 +VirtueMart 3.6.2 10159

I am trying to have the baseprice strikesthrough in cart if the price has a discount applied on it.
At the moment, the price is crossed out only if the discount is applied on the product after tax.
I want it to be crossed out when the discount is applied on the product before tax.

So i override the default_pricelist.php and modify as below:
if (VmConfig::get ('checkout_show_origprice', 1) && $prow->prices['discountedPriceWithoutTax'] != $prow->prices['priceWithoutTax'])

replaced by

if (VmConfig::get ('checkout_show_origprice', 1) && $prow->prices['discountedPriceWithoutTax'] != $prow->prices['basePriceVariant'])

It is working fine, but is it the correct way to do it? because I couldn't find the settings in virtuemart that can achieve this.

Thanks

Title: Re: strikesthrough prices in cart
Post by: GJC Web Design on December 11, 2019, 13:59:04 PM
from memory it only works out of the box if you have Vat pricing ...

but it is only a logic to apply a class that has strikethru written in the css so if it works for you its fine
Title: Re: strikesthrough prices in cart
Post by: holanpan7 on December 12, 2019, 12:09:17 PM
I have VAT princing but the crossed out price only works on the product page not on the cart. On the cart it only shows the discounted price.
That's why I had to modify default_pricelist.php

I will leave it as that then. Thanks anyway