I am using a theme called accu, and there is a product grid for example on the home page for quick buying.
The problem is these quick buy items in the grid don’t show a selector for the variant so its basically useless… Now I wanted to add it by just copying the code of the variant selector from the real product page to the grid, but if I select another variant it still uses the basic one when I click buy…
The code i copied from the product page was this one…
I used your code and it works perfect with a few adjustments.
Is it possible to also change the image according to the selected variant?
I think the code for the image is this one, I already tried to put the "product.selected_or_first_available_variant. " instead of only product. before the image.src but it doesnt work.
This requires a custom solution that requires to add some javascript and edits of more than one places. The solution can be determined after visiting your website only.