News:

Support the VirtueMart project and become a member

Main Menu

Wrong calculation in some cart listing order with custom fields values

Started by nanosmile, October 16, 2013, 09:18:27 AM

Previous topic - Next topic

nanosmile

Hello,

I’ve got a small problem with final goods calculation in the cart page /index.php/yourcart in specific listing order

So, what I have:
Localhost, PHP 5.3.3
Joomla! 2.5.14 Stable
Virtuemart 2.0.24

1.   Two kind of prices are shown to group for anonymous shoppers: Discounted Price without tax & Final salesprice
2.   Some products are in multiple price mode according to some range. These products are under Currency B/Applied default rules/Apply no rules mode.
3.   The shop has two currencies, lets say currency A and currency B mentioned above.
4.   By default the shop goes with currency A for all users e.g. anonymous group, frontend.
5.   In backend all goods have price B plus custom fields modification +/- percent and convertECB.php mode.
6.   The problem comes with goods with price calculation in cart if additional fields with values are used with any item in some kind of order on the page /index.php/yourcart


For instance,
A user add to cart item1 and item2. Item1 has no custom fields and item2 has ones with additional cost value. So, if I have order in the cart:

/index.php/yourcart

Item2 (custom fields)
Item1 (no custom fields)

It works like a charm! But, if a user has vice versa order in cart e.g.:

Item1 (no custom fields)
Item2 (custom fields)

I have a very funny calculation in cart page: /index.php/yourcart. The price of Item1 is ok. But the price of Item2 has wrong values. The wrong value seems come like one more time converted by convertECB.php I guess it’s bug or my poor knowledge of Virtuemart solution. I am newcomer and work with this charm shop solution only couple of weeks thus I beg you pardon if I haven’t considered something simple like tick in checkbox somewhere in backend:).

Many thanks for any feedback beforehand.


AH

The lack of an answer to you query may be just be that no-one has seen your problem and has no solution , rather that it being ignorance.
Regards
A

Joomla 4.4.5
php 8.1

nanosmile

lol, ok man, I’ll show U on sample data.

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 shopping cart custom fields)
2.   After that let’s add to cart the Chain Saw having chosen the size 50cm (item with shopping cart 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

[attachment cleanup by admin]