VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Gab on September 09, 2012, 02:50:42 AM

Title: Show Tax Rate
Post by: Gab on September 09, 2012, 02:50:42 AM
Hi! How can I show the tax rate in the Product Details page?

Example: VAT: 15.00 %

I'm using Joomla 2.5.6 & VM 2.0.10

Thanks!
Title: Re: Show Tax Rate
Post by: be on November 14, 2012, 16:13:56 PM
Hi,
same problem here.
How can I get the tax rate displayed. A displaying with an languagefile is not possible because i use different tax rates for my products.

Because tax rates are connected to categories, is it possible to proof if some of theese categories is set for the actual product?
And if its possible how does it work?

Best regards
Title: Re: Show Tax Rate
Post by: Henrik Holm Nielsen on February 20, 2014, 15:30:14 PM
Hi,

Anybody find a way to do this?
We have multiple tax rates on our products, and would like to show which tax rate is applied to each product, on the product-detail page.

Something like: Price : €25 (incl. 5.5% tax) instead of €25 incl. tax.

If anybody know the code to pick up the tax rate in the product-details page, I would love to know :)

Cheers ;)
Title: Re: Show Tax Rate
Post by: alatak on February 21, 2014, 14:32:52 PM
Hello
You can do it like this

$tax = ShopFunctions::getTaxByID($product->product_tax_id);
echo $tax['calc_value']  ." ". $tax['calc_value_mathop'];
Title: Re: Show Tax Rate
Post by: Henrik Holm Nielsen on February 22, 2014, 20:24:30 PM
Thanx Valérie,

This led me to the following in productdetails/default_showprices.php, which does the trick for us!
$tax = $this->product->product_tax_id;
$taxpct = $this->product->prices['Tax'];
echo '(Taxes '.($taxpct[$tax][1] + 0).'% comprises)';


Cheers :)
Title: Re: Show Tax Rate
Post by: be on September 17, 2014, 02:07:05 AM
Hello,
my own solution at this time was to count back the vat.

//VAT rate calculating
$nb = $this->product->prices['priceWithoutTax']; //net price
$mb = $this->product->prices['taxAmount']; //VAT value
$vat = $mb * 100/$nb;

if ($vat < 10) {
$resultvat = 7;
} else {
$resultvat = 19;
}
Title: Re: Show Tax Rate
Post by: Milbo on September 18, 2014, 09:55:26 AM
Please do

vmdebug('my taxes',$this->product->prices);

There you can see the used taxes