I am using Foxy for my ecommerce site. I have multiple product variants on a page and they are selected by clicking. In accordance with google standards I need to meet, I’m seeking help in adding/changing a url query parameter when the variant is changed. Additionally, when a url with a product variant query parameter is loaded, it should load with the referenced product variant selected.
I’m using $('#ID').click(function() to swap values in the Foxy add-to-cart HTML embed. I’m having trouble with the necessary code to modify query parameters on the same click. More so, I don’t know where to begin as far as parsing any query parameter that may be present on page load and triggering a click to select the corresponding product variant.
I havent yet figured out how to trigger a product variant selection when a variant is specified in the query on page load, but it seems I should have most of what I need now to figure it out. If anyone has any comments/suggestions/problems with the solution above, I’d be grateful to hear them. Or, of course, a solution to this second part of the problem.