diff --git a/CHANGELOG.md b/CHANGELOG.md index 5961190f6..afc352c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix product deletion from cart on logout->login on "out of stock" error - @SergeyDarnopykh ([#5974](https://github.com/vuestorefront/vue-storefront/issues/5974)) - Fix bug where adding/removing coupon would not honor the currently selected shipping method when syncing totals. - @didkan ([#6046](https://github.com/vuestorefront/vue-storefront/pull/6046)) - Fix bug that mutates `config.products.omitVariantFields` so that configurable products may be assigned the wrong base image. - @didkan ([#497](https://github.com/vuestorefront/vue-storefront-1/pull/497)) +- Fixed the code to display the unique images when setting the mergeConfigurableChildren to false - @ymaheshwari1 ([#404](https://github.com/vuestorefront/vue-storefront-1/issues/404)) ### Changed / Improved diff --git a/core/modules/catalog/helpers/getProductGallery.ts b/core/modules/catalog/helpers/getProductGallery.ts index 87709f7f2..e5ba9bfab 100644 --- a/core/modules/catalog/helpers/getProductGallery.ts +++ b/core/modules/catalog/helpers/getProductGallery.ts @@ -10,7 +10,10 @@ import Product from '@vue-storefront/core/modules/catalog/types/Product'; export default function getProductGallery (product: Product) { if (product.type_id === 'configurable' && product.hasOwnProperty('configurable_children')) { if (!config.products.gallery.mergeConfigurableChildren && product.is_configured) { - return attributeImages(product) + return uniqBy([ + ...attributeImages(product), + ...getMediaGallery(product) + ], 'src') } }