Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey! I'm looking for feedback & possible help for a project I'm working on. I'm trying to show variant metafield next to sizes. Here's the code I'm working on at the moment:
{%- if product.type == 'Cyklar' -%}
<div class="storlekstext">Passar längd:
<span>{{ variant.metafields.custom.langd.storleksguide_cyklar[0] }} - {{ variant.metafields.custom.langd.storleksguide_cyklar.value.last }}</span>
cm </div>
{% endif %}
Here's my metafield
Name: storleksguide cyklar
Namespace and key: custom.langd
Single line text
List of values
Since its a list of values I use "[0]" to get the first value and ".last" to get the last value. Final text should be something like "Passar längd: 170-185 cm" where 170 and 185 is values from the variant metafield.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025