I am wanting to pull back only results that are available but it is returning in the json response null,null,null,result, result for example. Here is the code:
{% capture results %}
{% for item in search.results %}
{% assign product = item %}
{% if product.available == true %}
{
"title" : {{ product.title | json }},
"url" : {{ product.url | within: product.collections.last | json }},
"thumbnail": {{ product.featured_image.src | product_img_url: 'thumb' | json }},
"available": {{ product.available | json }}
}
{% endif %}
{% unless forloop.last %},{% endunless %}
{% endfor %}
{% endcapture %}
Anyone know what i would need to do to not return the null results but only the available true ones and exclude the available(false)
It returns 9 results, 7 of which are not available and would show 2 but need it to return 9 available not 2 out of the 9 if you know what i mean.