News:

Looking for documentation? Take a look on our wiki

Main Menu

Multivariant selector disappears in grandchildren

Started by bortolani, March 21, 2017, 18:00:15 PM

Previous topic - Next topic

bortolani

Joomla 3.6.5
VM 3.0.20

I found a bug in the latest release that has to do with multivariants.
It only happens when you have a product with multi variants who is itself the child of another generic product.

It's tricky, so I try to explain it clearly:

Product F (father) is child of product G (Grandpa).
Product C (grandchild) is child of product F.

Product F shows the MV select dropdown normally.
Then you select a variant. Product C is shown. The MV select dropdown is not there any longer.

This does NOT happen with 'normal' MV children.
In other words if a product is a child of some other product, then multivariant behave bad.

You may see what happens here: https://www.puffosport.it/en/swimming/turbo-men-waterpolo-trunks/turbo-argentina-flag-detail
Select a size and you see that the selector disappears.

Also see the 2 attachments.

Thanks, Bruno


Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bortolani

#2
Hi Milbo,
Both F and G had the multivariant, and that could be one of the causes.

Actually it is not a problem with version 3.0.20 because it appears also with previous versions.

The faulty behaviour happens because the custom field gets copied into the children.
In practice a new record is created in the product_customfields table with product_id equal to the child's id.

When and why this happens I could not understand.
To clear the problem I deleted all the faulty records in product_customfields with phpmyadmin, but I don't know if it will re-appear in future, possibly due to an upgrade.

I'll let you know if I find out.
Very subtle bug!

Bruno

Milbo

It is not really a bug. The normal setup is that you use the G product as general pattern, the F product as the "real" parent product and the Cs as variants. Why do you need it the other way?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bortolani

Hi Milbo,
this is exactly my setup.
What happened, for a reason I haven't discovered, is that all the grandchildren got a MV custom field from the father (a new record in product_custom fields table)
This probably happened during an update since the G-F-C setup has been the same from the beginning.

Milbo

Quote from: bortolani on March 22, 2017, 14:36:43 PM
is that all the grandchildren got a MV custom field from the father (a new record in product_custom fields table)
Right, this should be only "virtual" that means there is no new entry in the table, you just see the custom field at the product

Nice that you use a more complex setup. We use it also in our store. Any vendor has its own pattern, it is quite handy and sometimes I think a lot people have no clue how much fun it makes to use it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/