I’m trying to add css to product options to provide the user with a visual indication of which options are not available. This works when a product only has one set of option values, however my product has two (“date”, and “time”). I have this working most of the way, however the available “Time” options are not updated when I switch between dates. Any help here would be hugely appreciated.
Inside my product-form.liquid file I have the following code to add a class to sold out options. Perhaps I need some js?
{%- if option.name == "Time" -%}
{%- if product.variants[forloop.index0].available -%}
{%- assign opt_sold = false -%}
{%- else -%}
{%- assign opt_sold = true -%}
{%- endif -%}
{%- else -%}
{%- assign opt_sold = false -%}
{%- endif -%}
