I’ve been trying to crack my head on this one. Creating new products now apparently doesn’t change the variant when I select the product images.
I implemented this months ago and it works fine until today.
Apparently it still works on the old products that was created but not the new ones.
Example :
I appreciate if anyone can shed some light on this one. Thank you very much in advance.
2
Answers
You can try this code: replace productJson.forEach in if (productJson.length > 0){ in function _selectVariant:
Note: Make sure the number of brackets {} is still complete.
I also found that uploading variant images directly onto the variant instead of using the main uploader and assigning it to the variant, it would work with the old code template. But using this code I did not have to go back and update all the old ‘broken’ variants and things seem to work with my old workflow.
Thanks, barkles. That worked like a charm!