Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shopifypartners/3b6219377f3dd426aa398896ae82dedf to your computer and use it in GitHub Desktop.
Save shopifypartners/3b6219377f3dd426aa398896ae82dedf to your computer and use it in GitHub Desktop.
Using JavaScript on client stores, create a new list-collections template - https://www.shopify.com/partners/blog/28500611-using-javascript-to-super-power-your-clients-shopify-site
{% layout none %}
{% paginate collections by 50 %}
{
"collections": [{% for collection in collections %}
{
{% if collection.image %}"image": "{{ collection.image }}",{% endif %}
"body_html": "{{ collection.description | url_escape }}",
"handle": "{{ collection.handle }}",
"id": {{ collection.id }},
"sort_order": "{{ collection.default_sort_by }}",
"template_suffix": "{{ collection.template_suffix }}",
"title": "{{ collection.title }}",
"products_count": {{ collection.products_count }},
"url": "{{ collection.url }}",
"products": []
}{% unless forloop.last %},{% endunless %}{% endfor %}
]
}
{% endpaginate %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment