Skip to content

Instantly share code, notes, and snippets.

@hezninja
Last active June 22, 2022 05:11
Show Gist options
  • Save hezninja/85bad967605890a0ce2a2b7c7cc30a97 to your computer and use it in GitHub Desktop.
Save hezninja/85bad967605890a0ce2a2b7c7cc30a97 to your computer and use it in GitHub Desktop.
Shopify Single Line Text (List) Iteration
<!--
Probably a bit hacky and i've overlooked an easier solution...
But for some reason looping through a "Single line text (List)" type metafield is problematic.
At least for me.
-->
{% assign singleLineList = product.metafields.custom.exampleList | replace:'"','' | replace:'[','' | replace:']','' | split: ',' %}
{% for listItem in singleLineList %}
<!-- Do stuff -->
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment