From 1c5bd875cc69ccfeb20a48a814dd3f1b58091c0a Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Fri, 28 Aug 2015 15:17:37 +0300 Subject: [PATCH] MAGETWO-42103: Minicart does not clear after completing an order via Paypal --- app/code/Magento/Checkout/etc/frontend/sections.xml | 6 ------ .../view/frontend/web/js/action/set-payment-method.js | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Checkout/etc/frontend/sections.xml b/app/code/Magento/Checkout/etc/frontend/sections.xml index b58f8ab3ad855..30546be368a76 100644 --- a/app/code/Magento/Checkout/etc/frontend/sections.xml +++ b/app/code/Magento/Checkout/etc/frontend/sections.xml @@ -46,10 +46,4 @@
- -
- - -
- diff --git a/app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js b/app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js index b7118b886ea76..bc2e616515481 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/action/set-payment-method.js @@ -9,9 +9,10 @@ define( 'Magento_Checkout/js/model/url-builder', 'mage/storage', 'Magento_Checkout/js/model/error-processor', - 'Magento_Customer/js/model/customer' + 'Magento_Customer/js/model/customer', + 'Magento_Customer/js/customer-data' ], - function ($, quote, urlBuilder, storage, errorProcessor, customer) { + function ($, quote, urlBuilder, storage, errorProcessor, customer, customerData) { 'use strict'; return function () { @@ -41,6 +42,7 @@ define( serviceUrl, JSON.stringify(payload) ).done( function () { + customerData.invalidate(['cart']); $.mage.redirect(window.checkoutConfig.payment.paypalExpress.redirectUrl[quote.paymentMethod().method]); } ).fail(