Predictive Search and Variants returned

Shopify Expert
42 0 19

Hi guys,


I have an issue where the variants and the Shopify support advised me to ask my question here, so I hope to find a solution for my issue.

My problem is that the variants of a product are returned only when the variant title matches the search query.  Otherwise, the variants array is empty. For my custom design, I need to have the id of the first_or_default_variant. To better explain this, I will post some pictures with examples. For my test, I will be using the default Debut theme demo.

1. When you search for a product title "Backpack" as you can see the variants array is empty.



2. When you search for the title of a variant "Navy" and the search is configured to check the variant titles, the variant array is filled with the matched variant.


3. Now following this logic, if you search for the word "Default", you will get the list of all products with just the default variant.



So does anyone think this is an issue with the returned results and have an idea of how to get the id of the first variant every time.


Thank you all in advance.


Best Regards,