Hello all,
I’m sure i’m doing something wrong. The predictive search api returns right products as results but the variants array is always empty (like an empty array is returned).
https://shopify.dev/docs/themes/ajax-api/reference/predictive-search
PS: we do have variants for products
Hi @hardfire
Hope you’re having a great day!
Did you specify variants option (possible values: variants.barcode, variants.sku, variants.title) among the “fields” values (the list of fields to search on) as done here?
{
"q": "very-fast snowbo",
"resources": {
"type": "product",
"limit": 5,
"options": {
"unavailable_products": "last",
"fields": "title,product_type,variants.title"
}
}
}
More details here.