VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: gofer123 on November 19, 2014, 03:04:06 AM

Title: Sales Tax to show in the shopping cart only
Post by: gofer123 on November 19, 2014, 03:04:06 AM
Hi all,
Is it possible (I've tried all sorts of combinations) for the sales tax to be displayed in the shopping cart only?
Cheers
VirtueMart 2.6.10
Joomla! 2.5.24
PHP 5.3.10
Title: Re: Sales Tax to show in the shopping cart only
Post by: AH on November 19, 2014, 09:26:00 AM
Firstly - you should upgrade both your Joomla and VM software
Your versions are reported as insecure.

Secondly,

When you enable tax it shows in the product page and the shopping cart
From your request I think that you want to only show tax in the shopping cart and not on the product pages etc(this is not a configurable option)

Consequently you will need to do a template override for the prices.

Keep the setting to show taxes and then remove the tax price display from the relevant pricing templates

Copy the following files into the relevant template override directories (create the "to" directories if they do not exist!)
components/com_virtuemart/views/productdetails/tmpl/default_showprices.php
to
templates/your-template/html/com_virtuemart/productdetails/default_showprices.php

Then remove or comment out

if ($this->product->prices['discountedPriceWithoutTax'] != $this->product->prices['priceWithoutTax']) {
echo $this->currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
} else {
echo $this->currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices);
}

and

echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices);




components/com_virtuemart/views/virtuemart/tmpl/default_products.php
to
templates/your-template/html/com_virtuemart/virtuemart/default_products.php


if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
echo $this->currency->createPriceDiv( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices );
} else {
echo $this->currency->createPriceDiv( 'priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices );
}

and

echo $this->currency->createPriceDiv( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices );


The tax amount will then not show in the products and category views but will show in the rest of the system
Title: Re: Sales Tax to show in the shopping cart only
Post by: gofer123 on November 19, 2014, 20:02:55 PM
Thanks very much for your time and help Hutson,
I'll get to work on that today.
Cheers
Title: Re: Sales Tax to show in the shopping cart only
Post by: gofer123 on November 19, 2014, 22:35:22 PM
Hi Hutson,
Sorry if this is a really stupid question but do I need to comment out both the original file and the one I've copied into the overrides folder?
The folder structure goes like this;
mytemplate/html/overrides/default_showprices.php
                                           default_products.php
Have I got the right?
Appreciate your help
Cheers
Title: Re: Sales Tax to show in the shopping cart only
Post by: GJC Web Design on November 19, 2014, 22:43:43 PM
folder structure->

mytemplate/html/com_virtuemart->
                                                      /productdetails/default_showprices.php
                                                     /virtuemart/default_products.php

just leave the originals alone
Title: Re: Sales Tax to show in the shopping cart only
Post by: gofer123 on November 19, 2014, 22:47:28 PM
Many thanks Hutson
Cheers
Title: Re: Sales Tax to show in the shopping cart only
Post by: gofer123 on November 20, 2014, 02:13:35 AM
Sorry Hutson, I just can't crack this, followed your precise instructions but no luck.
What configuration would you in VM configure, pricing? I've tried all sorts of combinations with the15% GST .
Any suggestions?
Title: Re: Sales Tax to show in the shopping cart only
Post by: AH on November 21, 2014, 18:44:48 PM
IN vm configuration

Check Show Tax in Cart

And for prices I have checked

Tax Amount
Sales Price without Tax

As well as some others
Title: Re: Sales Tax to show in the shopping cart only
Post by: gofer123 on November 21, 2014, 20:41:44 PM
Thank you Hutson, will give it another bash!
Cheers