useProductSearch and filter/result

Hi,

When I try to add a price filter with filters.price using the useProductSearch hook, the prices of the products returned do not match (e.g., 50-100, lower price returned).

Also, what would be the way to return the same currency for all products with useProductSearch?

Thank you!

Hi @Quique-Shopify I am experiencing the same issue with the price filters in the useProductSearch hook. Also the products are sometimes of different currencies, is there a way to only fetch products of a specific currency/region for example: EURO (€)

Why do prices of products returned by the useProductSearch hook not match the applied filters.price range?
Explanation:
The filters.price filter is always evaluated in USD, based on the price of all product variants. If any variant of a product matches the price filter (after conversion to USD), the product is included in the results, even if the product’s default variant or displayed price is outside the filter range, or in a different currency.

Example:
In the example data:

{ "price": { "amount": "289.0", "currencyCode": "SEK" }, "variants": { "nodes": [ { "price": { "amount": "289.0", "currencyCode": "SEK" } }, { "price": { "amount": "89.0", "currencyCode": "SEK" } } ] } }

If the USD equivalent of “89.0 SEK” matches the filter, the product is returned, even though the main price is “289.0 SEK,” which appears outside the filter.

Can prices returned by useProductSearch be forced to a specific currency (e.g., always USD or EUR)?
Explanation:
No. It is not possible to force currency unification or conversion at the API level. Each merchant or shop sets the currencies used in their store, and the API returns prices in the currency determined by each merchant. Currency normalization should not be done on client-side as well - we should show the price and currency that merchants are using.
Example:
Products in the example data return prices in several currencies:

{ "amount": "5.99", "currencyCode": "USD" } { "amount": "289.0", "currencyCode": "SEK" } { "amount": "4.2", "currencyCode": "GBP" } { "amount": "22.99", "currencyCode": "CAD" }

This reflects how each merchant has configured their store, and these currencies cannot be overridden by the client.

Thank you for this explanation, this should be documented, i was getting dollars and pounds as well.

Thanks for the explanation!

It seems that product variants are not always returned in the query, even if they do exist? When I query for a product with several existing variants, the variants are not returned in the query.

Furthermore, if I filter with 50-100 USD, for example, I get products returned for 5 USD or less with products that have no other variants, even on the actual product.