Skip to content

Instantly share code, notes, and snippets.

@jarred
Created April 7, 2014 21:28
Show Gist options
  • Save jarred/10060887 to your computer and use it in GitHub Desktop.
Save jarred/10060887 to your computer and use it in GitHub Desktop.
<script type="application/json" class="json" id="collection-data">
{
"parentCollection": false,
"handle": "{{ collection.handle }}",
{% paginate collection.products by 50 %}
"page": {{ paginate.current_page }},
"total_pages": {{ paginate.pages }},
"total_products": {{ paginate.items }},
"products": [{% for product in collection.products %}
{% include "json-product" %}
{% if forloop.last == false %},{% endif %}{% endfor %}],
{% if paginate.next %}
"next_page": "{{ paginate.next.url }}",
{% endif %}
"end": true
{% endpaginate %}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment