diff --git a/framework/shopify/api/operations/get-related-products.ts b/framework/shopify/api/operations/get-related-products.ts index ea60e277a..d70f982cd 100644 --- a/framework/shopify/api/operations/get-related-products.ts +++ b/framework/shopify/api/operations/get-related-products.ts @@ -65,8 +65,9 @@ export default function getRelatedProductsOperation({ return { products: data.productRecommendations - ?.map((product) => normalizeProduct(product as ShopifyProduct)) - .splice(0, variables?.first || 4) ?? [], + ?.sort(() => 0.5 - Math.random()) + .splice(0, variables?.first || 4) + .map((product) => normalizeProduct(product as ShopifyProduct)) ?? [], } }