Hello.
We are trying to make our displayed metafields change when a customer selects an option on a listing.
We have no problem with displaying “product.metafield”, or “variant.metafield”, it just does not change the “variant.metafield” when a different option is selected.
Here is our code in Custom Liquid:
{%- if product.metafields.custom.series != blank -%}
{%- endif -%}
{% for variant in product.variants %}
{%- if variant.metafields.custom.lens != blank -%}
{% if product.selected_or_first_available_variant.id == variant.id %}
{% endif %}
{%- endif -%}
{% endfor %}
| <br><br><b><br>SERIES:</b> {{ product.metafields.custom.series }}<br><br> |
| - |
| <br><br><b><br>LENS: </b> {{ variant.metafields.custom.lens }} <br><br><br> |
Thanks in advance!
Luke