VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: atrus on December 22, 2012, 11:13:31 AM

Title: 2.0.16 Adding 1 euro to all cost prices?! [SOLVED]
Post by: atrus on December 22, 2012, 11:13:31 AM
Hi to all,

We have noticed something strange with our installation: VM2 adds 1 euro (shop's default currency) to all cost prices when it displays them, i.e. if the cost price is set to 20 euros, VM2 will display 21 euros and so on! We have disabled all rules. When the product is added to the cart, its price is normal, 20 euros. So it is a matter of display only. We are checking any template overrides here also, but the issue persists, also confirmed on the beez20 template.

Any ideas what to check next?

Thanks,
Chris
Title: Re: 2.0.16 Adding 1 euro to all cost prices?!
Post by: Milbo on December 22, 2012, 11:26:17 AM
This happened due a change of a function. It shows clearly that you use some incompatible 3rd party or some layout overwrite. We changed in calculationh.php

public function getProductPrices($product, $catIds=0, $variant=0.0, $amount=0, $ignoreAmount=true, $currencydisplay=true) {


to

public function getProductPrices($product, $variant=0.0, $amount=0) {


check your layout, product_edit_information, search for getProductPrices, just delete the second param, done.
Title: Re: 2.0.16 Adding 1 euro to all cost prices?!
Post by: atrus on December 22, 2012, 13:14:31 PM
Thanks for your assistance, will check it out; (just a clarification: at the backend, all prices are shown correctly, it is only at the frontend that the 1 euro is added to the cost price)

Rgrds,
Chris

Title: Re: 2.0.16 Adding 1 euro to all cost prices?!
Post by: atrus on December 22, 2012, 14:24:03 PM
Hi again Milbo,

Just checked as per your instructions:

in /administrator/components/com_virtuemart/helpers/calculationh.php the code is actually:

public function getProductPrices($product, $variant=0.0, $amount=0, $ignoreAmount=true, $currencydisplay=true) { (the $catIds=0 only has been removed)

In our installation there doesn't seem to be any layout overwrite (or maybe we are missing smth). The only product_edit_information.php is located in /administrator/components/com_virtuemart/views/product/tmpl/  and the only call to getProductPrices is at the following line:

$this->calculatedPrices = $calculator->getProductPrices ($this->tempProduct);

In any case, the price calculation and display is perfectly correct at the backend. I.e. you can see for a product (no rules applied):

Cost price: 14.3 Euro
Base Price: 14.3 Euro
Final Price: 14.3 Euro

But when you go to the frontend the Salesprice is 15.3 Euro!

Rgrds,
Chris
Title: Re: 2.0.16 Adding 1 euro to all cost prices?!
Post by: Milbo on December 23, 2012, 11:15:03 AM
It is quite sure one of your hacks or layout overrides. It would be interesting to know which function is creating the problem, but at the end it has something todo with this function. Do you use plugins for your customfields?
Title: Re: 2.0.16 Adding 1 euro to all cost prices?!
Post by: atrus on December 28, 2012, 09:22:02 AM
Hi Milbo,

Thanks for the tip, we searched through all our plugins and the issue was found in a system plugin used by Chameleon extension (http://www.metamodpro.com/ (http://www.metamodpro.com/)). We have advised the developer accordingly and he will correct accordingly ;)

Rgrds,
Chris