VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Margriet on April 14, 2015, 10:12:16 AM

Title: Price modifier before tax shows wrong sign on frontend
Post by: Margriet on April 14, 2015, 10:12:16 AM
Joomla 3.4.1, VM 3.0.6.4
When using price modifier before tax to add i.e. Insurance costs, calculation works like it should, but in stead of showing either a + sign on frontend or nothing it shows a - sign.
Small detail: There is a text Welcome to, I think this should be Description.
Title: Re: Price modifier before tax shows wrong sign on frontend
Post by: Margriet on April 16, 2015, 11:48:34 AM
Did some research, but as I'm not a programmer I'm not sure if this is correct. But it seems to be caused by /administrator/components/com_virtuemart/helpers/calculationh.php from line 423 and onwards.
if(empty($this->rules['DBTax'])){
$this->productPrices['discountAmount'] = $this->roundInternal($basePriceWithTax - $this->productPrices['salesPrice']) * -1;
} else {
$this->productPrices['discountAmount'] = $this->roundInternal($this->productPrices['discountedPriceWithoutTax'] - $this->productPrices['basePriceVariant']) * -1;
}

If I change the multiplier from -1 to 1 it seems to work like expected.