I’m using the ProductSearchAPI and I need to return the products and their variants based on a search term:
const results = await api.productSearch.searchProducts({ queryString })
However, the above api call only returns the first variant for each product. As an example, I’ll search for the term HMG
. I have a product call HMG Basecoat that has 4 variants, as shown below:
When using the queryString hmg
in the searchProducts
endpoint, the following is returned:
Notice how only 1 variant is returned in the variants
array, even though numVariants
is correct with 4. This is happening with multiple products. How do I fix this to return all variants associated with a product?