Shopify product variants price range

Hi!
Is it possible to get minimum and maximum price for product variants from search results JSON? So we can show price range like on this page: https://shop.magnoliamarket.com/
Currently, search results JSON includes price_range field but it only shows price window that matches product.price and it’s not suitable for our needs.

To be fully honest here, I’m not completely confident about adding fields concerning the list of variants inside a variant record which is considered a product thanks to distinct. That sentence alone showcases perfectly the complexity induced here. That’s likely a separation which should be done, to avoid confusion, in two indices, a “variants” one and a “products” one, but this is unfortunately not doable without a breaking change.

This is why I’ve added two new fields with version 1.16.0 (docs) : variants_min_price and variants_max_price, because this use case will probably be more common than what I thought at the beginning.

However, for further readers, there are a lot of attributes which I don’t feel comfortable adding to the object. For instance, the list of variants options could make sense too, but this would overload the object with a lot of data and I don’t want to start handling products inside variants.

1 Like

Thanks for your fantastic support! I appreciate your fast feedback.

Hello,
if you want to show price range for each product with differents prices for variants, you can try this APP.
This app show price range for each product in all collections.
In app configuration, you can set also format for displaying price range, for example like From $5.00 to $9.99 or $5.00 - $9.99