News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[Solverd] Show product price WITH tax in cart! PLEASE HELP!!

Started by SnakeDragon, March 25, 2014, 19:07:33 PM

Previous topic - Next topic

SnakeDragon

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):


This is how it looks in VM2 (this is where I have the problem with showing the product price with tax):


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

SnakeDragon

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

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum