Shopify - get all variants of a product on InstantSearch page

On the InstantSearch page, I am showing products instead of variants.
So we can see only one variant in each product.

Is there any way to get all variants of a product?
I can’t see any code to get all variant of product in algolia_instant_search_product.hogan.liquid
file.

Hi @yudechen, You can choose to see all variants or you can choose to show products, but you can’t choose products and see all variants. Choosing products will choose the most relavent product based on your Algolia configuration.

Hi, @cindy.cullen thanks for your reply.

I am not sure where I can choose to see all variants.

Hi @yudechen, you should be able to choose between displaying the products or the variants on the Display tab.

Hi, @cindy.cullen
Sorry for not providing details.

If we choose to show products instead of variants, the products will be shown with only one variant on the InstantSearch page.
But I want to show all the variants with a dropdown.

Hi @yudechen,

I believe you will need to customize your theme to create a dropdown. You can find more information about customizing Shopify here.

Hi @cindy.cullen
I could show first variant with this code.

<p class="ais-hit--variant_title">
  [[& variant_title]]
</p> 

But I want to get all variants to show variants with dropdowns.
Is there any way to get all variants with each title and variant link?

Thank you.