Skip to content

Commit

Permalink
Merge pull request #554 from magento-folks/MAGETWO-40559
Browse files Browse the repository at this point in the history
[Merchant Beta] MAGETWO-42103: Minicart does not clear after completing an order via …
  • Loading branch information
Korshenko, Olexii(okorshenko) committed Aug 31, 2015
2 parents d471820 + a9713c8 commit d0dd2b9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
13 changes: 13 additions & 0 deletions app/code/Magento/Braintree/etc/frontend/sections.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../Customer/etc/sections.xsd">
<action name="braintree/paypal/placeOrder">
<section name="cart"/>
</action>
</config>
13 changes: 13 additions & 0 deletions app/code/Magento/Paypal/etc/frontend/sections.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../Customer/etc/sections.xsd">
<action name="paypal/express/placeOrder">
<section name="cart"/>
</action>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d0dd2b9

Please sign in to comment.