Skip to content

Commit

Permalink
Merge pull request vuestorefront#3766 from gibkigonzo/bugfix/display-…
Browse files Browse the repository at this point in the history
…reviews-for-configurable-products

backport - disable product mutation when assigning product variant
  • Loading branch information
andrzejewsky authored Nov 5, 2019
2 parents af640f3 + bb7feb2 commit a996b04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.10.5] - unreleased

### Fixed
- disable product mutation when assigning product variant - @gibkigonzo (#3735)

## [1.10.4] - 18.10.2019

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions core/modules/catalog/store/product/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ const actions: ActionTree<ProductState, RootState> = {
}
if (configuration) {
let selectedVariant = configureProductAsync(context, { product: product, configuration: configuration, selectDefaultVariant: false })
Object.assign(product, omit(selectedVariant, ['visibility']))
product = Object.assign({}, product, omit(selectedVariant, ['visibility']))
}
if (product.url_path) {
rootStore.dispatch('url/registerMapping', {
Expand Down Expand Up @@ -430,7 +430,7 @@ const actions: ActionTree<ProductState, RootState> = {
// todo: probably a good idea is to change this [0] to specific id
const selectedVariant = configureProductAsync(context, { product: prod, configuration: { sku: options.childSku }, selectDefaultVariant: selectDefaultVariant, setProductErorrs: true })
if (selectedVariant && assignDefaultVariant) {
prod = Object.assign(prod, selectedVariant)
prod = Object.assign({}, prod, selectedVariant)
}
} else if (!skipCache || (prod.type_id === 'simple' || prod.type_id === 'downloadable')) {
if (setCurrentProduct) context.dispatch('setCurrent', prod)
Expand Down

0 comments on commit a996b04

Please sign in to comment.