VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: bartpg on June 27, 2014, 14:55:47 PM

Title: Unitprice without tax
Post by: bartpg on June 27, 2014, 14:55:47 PM
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.
Title: Re: Unitprice without tax
Post by: jenkinhill on June 27, 2014, 15:10:51 PM
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.
Title: Re: Unitprice without tax
Post by: bartpg on June 27, 2014, 16:48:05 PM
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.
Title: Re: Unitprice without tax
Post by: bartpg on July 02, 2014, 15:06:22 PM
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).