Products in my store have a number of options, but not all options are available for all products.
For instance, there are 2 ‘fabric type’ options, each of which has its own selection of color options.
If the customer selects a ‘fabric type’ and ‘color’, but then changes the ‘fabric type’, the selected variant does not automatically update and the selected option is displayed as crossed out (i.e. unavailable ) see screenshots below.
On change of and OPTION, I would like the VARIANT to update automatically to the first available VARIANT having all of the selected OPTIONS (unless the currently selected variant is still valid).
Can this be achieved through javascript / liquid?
The examples I have seen are triggered by change of VARIANT, but I want to trigger a VARIANT UPDATE on change of OPTION.
Thanks!
FABRIC TYPE AND COLOR SELECTED FIRST - AND VARIANT UPDATES
FABRIC TYPE OPTION UPDATED BY USER - BUT SELECTED VARIANT DOES NOT UPDATE AND COLOR OPTION IS DISPLAYED AS CROSSED-OUT (I.E. UNAVALABLE)

