Variant URL does not update add to cart

CPP
New Member
1 0 0

Hello! I really need help with this.

Everytime a client finds my ads on google and he click on it, google uses a direct link to the variant he saw on the ads, like www.store.com/products/xxxxxxx?variant=xxxxxxxx.

The problem is that once my store website open it has the variant already selected on dropdown, but if he click on "add to cart" directly the wrong variant id added to cart, always the first variant of the option 1 and the first of option 2, not the one he sees on the dropdown. He needs to manualy change the variants forth and back so the add to cart button is updated to the correct variants.

Exemple: He sees an ads of a Green t-shirt Small, he open the link and he sees both "green" and "small" selected in the variants dropdown. He click to add to cart and the product that is added is "black" and "large", because both are the first ones in the dropdown. I've tested everything, tried some console.warn() in 30+ js to try to figure it out but after 30+ days I gave up.

Does anyone know how to solve it? I guess is an "update add to cart button" problem, but only a guess.

I can send my store link in private if needed.

Thanks!

0 Likes