diff --git a/CHANGELOG.md b/CHANGELOG.md index f66bb0b366..1c9b869fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use `setProductGallery` in `product/setCurrent` to use logic of the action - @cewald (#4153) - Use same data format in getConfigurationMatchLevel - @gibkigonzo (#4208) - removed possible memory leak in ssr - @resubaka (#4247) +- Bugfix for reactivity of `current_configuration` in `populateProductConfigurationAsync` - @cewald (#4258) - Bugfix for build exception in Node v13.13+ - @cewald (#4249) ### Changed / Improved diff --git a/core/modules/catalog/helpers/index.ts b/core/modules/catalog/helpers/index.ts index 5bdaaaa8ed..76ac66edd1 100644 --- a/core/modules/catalog/helpers/index.ts +++ b/core/modules/catalog/helpers/index.ts @@ -1,3 +1,4 @@ +import Vue from 'vue' import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus' import rootStore from '@vue-storefront/core/store' import flattenDeep from 'lodash-es/flattenDeep' @@ -5,7 +6,6 @@ import omit from 'lodash-es/omit' import remove from 'lodash-es/remove' import toString from 'lodash-es/toString' import union from 'lodash-es/union' -import isObject from 'lodash-es/union' // TODO: Remove this dependency import { optionLabel } from './optionLabel' import i18n from '@vue-storefront/i18n' @@ -474,7 +474,7 @@ export function populateProductConfigurationAsync (context, { product, selectedV id: selectedOption.value, label: selectedOption.label ? selectedOption.label : /* if not set - find by attribute */optionLabel(context.rootState.attribute, { attributeKey: selectedOption.attribute_code, searchBy: 'code', optionId: selectedOption.value }) } - context.state.current_configuration[attribute_code] = confVal + Vue.set(context.state.current_configuration, attribute_code, confVal) } if (config.cart.setConfigurableProductOptions) { const productOption = setConfigurableProductOptionsAsync(context, { product: product, configuration: context.state.current_configuration }) // set the custom options