Skip to content

Instantly share code, notes, and snippets.

@unofficialshopify
Created September 23, 2016 06:41
Show Gist options
  • Save unofficialshopify/0f75119e110ebb69b9bc205388207dcc to your computer and use it in GitHub Desktop.
Save unofficialshopify/0f75119e110ebb69b9bc205388207dcc to your computer and use it in GitHub Desktop.
{% layout none %}
{% capture results %}
{% for item in search.results %}
{% assign product = item %}
{
"title" : {{ product.title | json }},
"url" : {{ product.url | within: product.collections.last | json }},
"thumbnail": {{ product.featured_image.src | product_img_url: 'thumb' | json }}
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
{% endcapture %}
{
"results_count": {{ search.results_count }},
"results": [{{ results }}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment