Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tobymarsden/19a12f1d719ef5b4fd573a064baafca3 to your computer and use it in GitHub Desktop.
Save tobymarsden/19a12f1d719ef5b4fd573a064baafca3 to your computer and use it in GitHub Desktop.
collection/hypervisual-data.liquid
{% layout none %}
{% paginate collection.products by 50 %}
{ "products": [{% for product in collection.products %}
{
{% if product != blank %}
"active_currency": "{{cart.currency.iso_code }}",
"id": {{product.id | json}},
"title": {{product.title | json}},
"vendor": {{product.vendor | json}},
"handle": {{product.handle | json}},
"featured_image": {{product.featured_image | json }},
"variants": [{% for variant in product.variants %}{
"id": {{variant.id}},
"title": {{variant.title | json}},
"option1": {{variant.option1 | json}},
"option2": {{variant.option2 | json}},
"option3": {{variant.option3 | json}},
"sku": {{variant.sku | json}},
"featured_image": {{variant.featured_image | json}},
"available": {{variant.available | json}},
"name": {{variant.name | json}},
"public_title": {{variant.public_title | json}},
"options": {{ variant.options | json}},
"price": {{variant.price | json}},
"formatted_price": {{ variant.price | money | json}},
"compare_at_price": {{variant.compare_at_price | json}},
"formatted_compare_at_price": {{ variant.compare_at_price | money | json}},
"inventory_management": {{variant.inventory_management | json}},
"inventory_policy": {{variant.inventory_policy | json}},
"inventory_quantity": {{variant.inventory_quantity | json}}
}{% if forloop.last == false %},{% endif %}{% endfor %}],
"options": {{ product.options_with_values | json }},
"images": {{product.images | json}}
{% endif %}
}{% if forloop.last == false %},{% endif %}
{% endfor %} ],
"items": {{paginate.items | json}},
"current_page": {{paginate.current_page | json}},
"pages": {{paginate.pages | json}},
"page_size": {{paginate.page_size | json}},
"current_offset": {{paginate.current_offset | json}}
}
{% endpaginate %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment