diff --git a/CHANGELOG.md b/CHANGELOG.md index 96b6cc0b6a..d1ee89cac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.10.5] - unreleased ### Fixed +- Disable product mutation when assigning product variant - @gibkigonzo (#3735) +- Fix issue with Cannot assign to read only property 'storeCode' - @yuriboyko (#3748) - Render correct category links when multistore is active - @gibkigonzo (#3753) - Disable product mutation when assigning product variant - @gibkigonzo (#3735) diff --git a/core/lib/multistore.ts b/core/lib/multistore.ts index 6c019ffcc8..dbf90e9550 100644 --- a/core/lib/multistore.ts +++ b/core/lib/multistore.ts @@ -24,9 +24,13 @@ export async function prepareStoreView (storeCode: string): Promise { } const storeViewHasChanged = !rootStore.state.storeView || rootStore.state.storeView.storeCode !== storeCode if (storeCode) { // current store code - if ((storeView = config.storeViews[storeCode])) { + const currentStoreView = config.storeViews[storeCode] + if (currentStoreView) { + storeView = Object.assign({}, currentStoreView); storeView.storeCode = storeCode rootStore.state.user.current_storecode = storeCode + } else { + console.warn(`Not found 'storeView' matching the given 'storeCode': ${storeCode}`) } } else { storeView.storeCode = config.defaultStoreCode || ''