VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: ZoBabe on June 20, 2015, 06:24:40 AM

Title: Another Multi-Variant Issue
Post by: ZoBabe on June 20, 2015, 06:24:40 AM
While it seems to be working OK on my end, every third order or so complains that the wrong size/color options are getting added to their cart. I'm guessing this is because the new mult-variant system loads the actual child product every time a selection is made, and the child product hasn't loaded yet by the time they hit "Add to Cart." This is just the latest in a long line of inconveniences caused by having to load each child product page rather than just the options.
  It's getting very annoying. Is there anything that can be done about it?
  Thanks!

Joomla: 3.4.1
Virtuemart: 3.0.9
Title: Re: Another Multi-Variant Issue
Post by: balai on June 20, 2015, 12:19:56 PM
Possibly hide the cart btn until the ajax call is completed. I suppose it is quite easy just to add a hide css rule in the script that performs the ajax and a display when it is completed
Title: Re: Another Multi-Variant Issue
Post by: Studio 42 on June 22, 2015, 20:43:39 PM
Hi,
Quote from: balai on June 20, 2015, 12:19:56 PM
Possibly hide the cart btn until the ajax call is completed. I suppose it is quite easy just to add a hide css rule in the script that performs the ajax and a display when it is completed
This is not a solution, i think you don't have understand the real bug.

If you are in a page, the  user set some options.
When you load a child, the complete product get reloaded.
Of course, because the old selected fields are not saved, the new child is reset to default and if he add it to cart this use the new(default) values if you don't reselect the same option as the old product.
One way, is to use a javascript cookies each time the user set an option(or using local storage), this mean that currently virtuemartt code does not have the javascript to retain the old value and changing child loose the selected options.

Of course this is not so simple, because the child can have some other options, or not the same number of options or option having different values ....

I think, perhaps adding a message, Please reselect your option is the easiest way to fix customer complains.

Greets,
Patrick
Title: Re: Another Multi-Variant Issue
Post by: Milbo on June 23, 2015, 09:35:06 AM
I think you are right Patrick,

But the selected variant of the Multivariant should be selected. But of course other variant types (is input strings) must be reselected. Patrick explained correctly that the other variants depend on their selected child and are usually different for any child.