VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: SnakeDragon on March 25, 2014, 19:07:33 PM

Title: [Solverd] Show product price WITH tax in cart! PLEASE HELP!!
Post by: SnakeDragon on March 25, 2014, 19:07:33 PM
Dear everybody,

I have been searching for this everywhere but I can't seem to find the answer and it's driving me crazy.
How do I show the price of a product including tax in the cart?

This is how it looks in VM1 (this is the old website and I want to make the new website look like this):
(http://imageshack.com/a/img27/7745/tztm.png)

This is how it looks in VM2 (this is where I have the problem with showing the product price with tax):
(http://imageshack.com/a/img855/1465/559t.png)

It's a Danish website and all prices shown should be including VAT (which is 25%).

Please help!

VM 2.0.26d
Joomla! 2.5.19
Title: Re: Show product price WITH tax in cart! PLEASE HELP!!
Post by: SnakeDragon on March 25, 2014, 19:23:34 PM
Okay, I found the answer after several hours of pulling my hair...

In templates\[your template]\html\com_virtuemart\cart\default_pricelist.php, around line 153 you find the following:

if (VmConfig::get ('checkout_show_origprice', 1) && $this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax'] != $this->cart->pricesUnformatted[$pkey]['priceWithoutTax']) {
echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $this->cart->pricesUnformatted[$pkey], TRUE, FALSE) . '</span><br />';
}
if ($this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax']) {
echo $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax', '', $this->cart->pricesUnformatted[$pkey], FALSE, FALSE);
} else {
echo $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $this->cart->pricesUnformatted[$pkey], FALSE, FALSE);
}
// echo $prow->salesPrice ;


Replace
if ($this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax']) {
echo $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax', '', $this->cart->pricesUnformatted[$pkey], FALSE, FALSE);
}


with
if ($this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax']) {
echo $this->currencyDisplay->createPriceDiv ('salesPrice', '', $this->cart->pricesUnformatted[$pkey], FALSE, FALSE);
}


I think it's strange that nobody has posted about this anywhere (I didn't manage to find it at least). Hope this helps others who encounter the same problem as I did
Title: Re: [Solverd] Show product price WITH tax in cart! PLEASE HELP!!
Post by: jenkinhill on March 25, 2014, 21:51:47 PM
The error was in your override template - probably was made for an earlier VM version.  The problem does not occur with the default VM templates.