Answer the question
In order to leave comments, you need to log in
How to change attributes in Wocomertz in a variable product by clicking on a photo?
When you click on an attribute in a variable product, the photo changes, but how can I do the opposite? When you click on the photo, change the attribute.
Like here
https://sofatex-sofacovers.com/collections/all/pro...
Answer the question
In order to leave comments, you need to log in
Through JS.
You catch a click on the picture and change the value of the select, after that you call its change event so that woo would count its variables.
You can see an example in plugins that replace the standard select with buttons (for example, Variation Swatches for WooCommerce)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question