I am using VueJS to loop through shopify liquid objects as shown below:
items: [
{% for product in collections['components'].products %}
{
title: "{{ product.title }}",
handle: "{{ product.handle }}",
image: "{{ product.featured_image | img_url: '400x', scale: 2 }}",
product_id: "{{ product.id }}",
variant_id: "{{ product.selected_or_first_available_variant.id }}",
sku: "{{ product.selected_or_first_available_variant.sku }}",
price: "{{ product.selected_or_first_available_variant.price | money }}",
variants: [
{% for variant in product.variants %}
{
title: "{{ variant.title }}"
},
{% endfor %}
]
},
{% endfor %}
],
On the variants property I am getting an empty array though I know there are variants or at least one variant for each product. I am suspecting the syntax might be wrong. What could be the issue?