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

Unitprice without tax

Started by bartpg, June 27, 2014, 14:55:47 PM

Previous topic - Next topic

bartpg

Virtuemart version: 2.6.6
Joomla version: 2.5.22

I'm trying to find a way to show the unitprice without tax, while using the option to apply tax per product rather than per invoice. Unfortunately I've only found some threads on this board regarding VM1.1, without a reply. I can't seem to set this up through the options (or I've just not been looking good enough).

As said, prices show up excluding tax when calculating tax per invoice, but due to the fact that the shop has different tax levels depending on each product, this isn't an option.

jenkinhill

For each product you can display the following:
Salesprice without tax  = unit price
Tax amount     = tax to be added
Final salesprice   = final price inc tax

These are configured in VM Configuration/Pricing. You may have to edit the price display view files and use the edited files as template overrides to ensure that they display correctly on your pages.
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

bartpg

Thanks for your reply.

A unit price can also be displayed (e.g. 5 euro per kg). The price this shows seems dependant on the way tax is applied (per product or per invoice). If the tax rules are applied per product, the unit price will show a price INCLUDING tax. If the tax rules are applied per invoice, the unit price will show a price EXCLUDING tax. This is probably due to the fact that the price is calculated by dividing the product price by the number filled in in the Product Dimensions and Weight-tab.

What I meant to ask: is there a way to show the unit price excluding tax, if the tax is applied per product instead of per invoice/bill.

bartpg

#3
For now I've changed the following file:

administrator\components\com_virtuemart\helpers\calculationh.php on line 376-380:

if(!empty($product->product_packaging) and $product->product_packaging!='0.0000'){
$this->productPrices['unitPrice'] = $this->productPrices['salesPrice']/$product->product_packaging;
} else {
$this->productPrices['unitPrice'] = 0.0;
}

to

if(!empty($product->product_packaging) and $product->product_packaging!='0.0000'){
$this->productPrices['unitPrice'] = $this->productPrices['priceBeforeTax']/$product->product_packaging;
} else {
$this->productPrices['unitPrice'] = 0.0;
}


It would be great if this additional variable could be added in a future version, for those wanting to show the unitPrice without tax (e.g. unitPriceBeforeTax).