diff --git a/CHANGELOG.md b/CHANGELOG.md index bf09661d2c..86a2fda276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ### Fixed +- Confirmation popup 'Product has beed added to cart' is displayed only once - @JKrupinski (#2610) - Moved My Account options from Categories - @bartdominiak (#2612) ### Changed / Improved diff --git a/core/modules/cart/store/actions.ts b/core/modules/cart/store/actions.ts index cf39c6e479..da38373605 100644 --- a/core/modules/cart/store/actions.ts +++ b/core/modules/cart/store/actions.ts @@ -704,21 +704,18 @@ const actions: ActionTree = { rootStore.commit('cart/' + types.CART_DEL_NON_CONFIRMED_ITEM, { product: originalCartItem }, {root: true}) } } else { - const isThisNewItemAddedToTheCart = (!originalCartItem || !originalCartItem.item_id) - if (isThisNewItemAddedToTheCart) { - let notificationData = { - type: 'success', - message: i18n.t('Product has been added to the cart!'), - action1: { label: i18n.t('OK') }, - action2: null - } - if (!config.externalCheckout) { // if there is externalCheckout enabled we don't offer action to go to checkout as it can generate cart desync - notificationData.action2 = { label: i18n.t('Proceed to checkout'), action: () => { - context.dispatch('goToCheckout') - }} - } - rootStore.dispatch('notification/spawnNotification', notificationData) + let notificationData = { + type: 'success', + message: i18n.t('Product has been added to the cart!'), + action1: { label: i18n.t('OK') }, + action2: null + } + if (!config.externalCheckout) { // if there is externalCheckout enabled we don't offer action to go to checkout as it can generate cart desync + notificationData.action2 = { label: i18n.t('Proceed to checkout'), action: () => { + context.dispatch('goToCheckout') + }} } + rootStore.dispatch('notification/spawnNotification', notificationData) } }, toggleMicrocart ({ commit }) {