Skip to content

Instantly share code, notes, and snippets.

@iamkeir
Created September 7, 2017 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamkeir/6c52fd21b12a77c40ec5d8814414af8f to your computer and use it in GitHub Desktop.
Save iamkeir/6c52fd21b12a77c40ec5d8814414af8f to your computer and use it in GitHub Desktop.
{% for block in section.blocks %}
<!-- Could also work with collections, blogs, articles... -->
{% if product.handle == block.settings.product %}
<!-- Could also be a snippet include -->
{{ block.settings.product['some_value'] }}
{% endif %}
{% endfor %}
{% schema %}
{
"name": "Product data",
"blocks": [
{
"type": "product-data",
"name": "Product info",
"settings": [
{
"id": "product",
"type": "product",
"label": "Choose product"
},
{
"id": "some_value",
"type": "text",
"label": "Some value"
}
]
}
]
}
{% endschema %}
@iamkeir
Copy link
Author

iamkeir commented Sep 7, 2017

Principally allows 'pseudo-dynamic' section data on each product page (or other dynamic page) in Shopify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment