News:

Looking for documentation? Take a look on our wiki

Main Menu

customs fields and calculation in cart

Started by nanosmile, October 22, 2013, 22:53:17 PM

Previous topic - Next topic

nanosmile

Hi2all,
I guess my previous report regarding a possible bug go unnoticed cause I published the issue to Product pricing category of the forum.

So, it’s very strange that nobody care about very simple point: bug in calculation in shopping cart page while using two currencies and products with cart attribute custom fields. And it’s strange – the issue can be checked by support while 5 mins…

Thus I duplicate the issue here.
SOS:)

/////////////

Clear experimental. Just installed Joomla! 2.5.14 with sample data and just installed Virtuemart 2.0.24 with sample data, localhost, Apache/2.2.4 (Win32) mod_ssl/2.2.4 OpenSSL/0.9.8k PHP/5.3.3

So, some preparations:
1.   Atomic template – by default
2.   Home from main menu assigned to VirtueMart ยป Front page & shopping cart goes to the menu as well
3.   vmfiles folder is set and writable


And what we see, let’s have a look:





So, variant 1
Let’s add to shopping cart two items consequentially.
1.   First we add to cart the Hammer (item without Cart Attribute custom fields)
2.   After that let’s add to cart the Chain Saw having chosen the size 50cm (item with Cart Attribute custom fields).

let’s have a look what we have in cart:




Please note Chain saw Price now 144, 69 and total is 179,49 €

So, variant 2
Let’s make just the same but with conversely order.

1.   First we add to cart the Chain Saw having chosen the size 50cm
2.   After that let’s add to cart the Hammer

let’s have a look what we have in cart now:



WOW, lol we’ve got another Chain saw Price and another total. Chain saw price is 135,29 € and total is 168,12 €. I should notice that’s very fun when U work with other currencies which exchange rate is not so close as euro and dollar. U just receive fantastic calculation figures difference working with let’s say euro and russian rubles:).

In short tell me please how to manage this BLATANTLY OBVIOUS problem cause it seems a bug in calculation depending on order list in cart.


/////////////






Regards,
Eugene

Milbo

Thank you very much.

Found and fixed. It was a missing line and the problem was that the cart calculation used for the customfield values the last currency id... so for the fist product there was no currency id.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

nanosmile

Milbo,
whould U be so kind to help me as well with the missing line? What line and which file to edit.

Please please please:)

Many thx beforehand.

Regards,
Eugene

Milbo

function getCheckoutPrices in calculationh.php in BE/helpers.

line 655 add $this->productCurrency = isset($product->product_currency)? $product->product_currency:0;
before $variantmods = $this->parseModifier($name);
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

nanosmile

Works like a charm!!!
I do highly appreciate the solution!

Regards,
Eugene