Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I'm using the Dawn theme and I'm trying to add some informations on the product page when a variant is selected.
I've created some metafield for my variants.
I've added a custom liquid block on my product page but it always shows the same metafield.
It's doesn't change according to the selected variant.
Here is the custom liquid I've used :
<h3>
{% for variant in product.variants %}
{% if variant.metafields.custom.size.value != blank %}
{% if product.selected_or_first_available_variant.id == variant.id %}
{{ variant.metafields.custom.size }}
{% endif %}
{% endif %}
{% endfor %}
</h3>
How to display only the metafield of the selected variant ?
Thank you in advance for any help.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024