diff --git a/.changeset/heavy-hotels-lie.md b/.changeset/heavy-hotels-lie.md index 2323f8340..a39302602 100644 --- a/.changeset/heavy-hotels-lie.md +++ b/.changeset/heavy-hotels-lie.md @@ -3,3 +3,4 @@ --- Fix sort order of `additionalProducts` prop in `ProductsCarousel` Makeswift component. +Sort product IDs before sending requests to BC so cache can be utilized in `ProductCarousel` diff --git a/core/lib/makeswift/utils/use-products.ts b/core/lib/makeswift/utils/use-products.ts index 7b16bc24b..4215a8455 100644 --- a/core/lib/makeswift/utils/use-products.ts +++ b/core/lib/makeswift/utils/use-products.ts @@ -38,7 +38,7 @@ export function useProducts({ collection, collectionLimit = 20, additionalProduc const searchParams = new URLSearchParams(); - searchParams.append('ids', additionalProductIds.join(',')); + searchParams.append('ids', additionalProductIds.sort().join(',')); searchParams.append('locale', locale); const additionalProductsUrl = `/api/products/ids?${searchParams.toString()}`;