J 3.8.5 - VM 3.2.12
Hi,
I was creating variants in a parent product and I wanted to change the order of the variants (there are 3 variants); I deleted the second variant because I wanted to be the third and I saved. From this point I can not open anymore the parent product, I receive the following error: Cannot use object of type stdClass as array
Any suggestion? thank you
Giuseppe
I solved taking all the description data from the DB deleting the faulty product and creating a new one, but I would like to know what happened just not to repeat it, thank you.
Giuseppe.
This happens because after a deletion of a ramification the options associated to the child products are saved as an object instead of a normal array. Then in visualization this is not considered. I fixed modifying line 285 of file models/customfields.php from:
if(!isset($myoption[$k])){
to
if (is_object($myoption) && property_exists($myoption, $k)) {
$value = $myoption->$k;
} else if(!isset($myoption[$k])){
is not the best fix, would be better to fix the save when a ramification is deleted. On top of that any update of VM will rewrite the file and you will lose the modification.
Hope they will release an update with a definitive fix to this issue
Same topic also here: https://forum.virtuemart.net/index.php?topic=136939.0
Yes, multi variant have know bugs. I dont checked because i find it too complex and use other solutions.