Hi Everyone,
We are trying to use product recommendations using shopify-buy in react. Until few days ago, we were able to fetch products using custom product recommendation api with shopify-buy/index.unoptimized.umd.
But this has stopped working now. We tried to update to recent version also to check the in-built product fetchRecommendations (https://github.com/Shopify/js-buy-sdk/blob/master/CHANGELOG.md#v2151-april-4-2022), but we are not getting the products using this as well.
Both Api are responding with empty products list in product recommendations.
In Built API
client.product.fetchRecommendations(productId)
Custom API
const temp = client.graphQLClient.query((root) => {
root.add(
'productRecommendations',
{ args: { productId: `${productId}` } },
(product) => {
product.add('id');
product.add('title');
}
);
});
client.graphQLClient.send(temp);
Thanks in advance.