Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Fixed the code to display the unique images and media_gallery on the product page(#404) #490

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion core/modules/catalog/helpers/getProductGallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}

Expand Down