Created
June 11, 2020 20:55
-
-
Save tobymarsden/19a12f1d719ef5b4fd573a064baafca3 to your computer and use it in GitHub Desktop.
collection/hypervisual-data.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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