Author Topic: [Solverd] Show product price WITH tax in cart! PLEASE HELP!!  (Read 1173 times)

SnakeDragon

  • Jr. Member
  • **
  • Posts: 61
[Solverd] Show product price WITH tax in cart! PLEASE HELP!!
« 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):


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

  • Jr. Member
  • **
  • Posts: 61
Re: Show product price WITH tax in cart! PLEASE HELP!!
« Reply #1 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:

Code: [Select]
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
Code: [Select]
if ($this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax']) {
echo $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax', '', $this->cart->pricesUnformatted[$pkey], FALSE, FALSE);
}

with
Code: [Select]
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28464
  • Always on vacation
    • Jenkin Hill Internet
Re: [Solverd] Show product price WITH tax in cart! PLEASE HELP!!
« Reply #2 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.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 4.0.12 10777  J 3.10.11 PHP 7.4.30