Skip to content

Commit b460994

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-97488' into 2.3-develop-pr14
2 parents 4126508 + f4d917c commit b460994

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

app/code/Magento/Checkout/etc/frontend/sections.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
</action>
4747
<action name="rest/*/V1/guest-carts/*/payment-information">
4848
<section name="cart"/>
49-
<section name="checkout-data"/>
5049
</action>
5150
<action name="rest/*/V1/guest-carts/*/selected-payment-method">
5251
<section name="cart"/>

app/code/Magento/Checkout/view/frontend/web/js/model/place-order.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ define(
99
[
1010
'mage/storage',
1111
'Magento_Checkout/js/model/error-processor',
12-
'Magento_Checkout/js/model/full-screen-loader'
12+
'Magento_Checkout/js/model/full-screen-loader',
13+
'Magento_Customer/js/customer-data'
1314
],
14-
function (storage, errorProcessor, fullScreenLoader) {
15+
function (storage, errorProcessor, fullScreenLoader, customerData) {
1516
'use strict';
1617

1718
return function (serviceUrl, payload, messageContainer) {
@@ -23,6 +24,23 @@ define(
2324
function (response) {
2425
errorProcessor.process(response, messageContainer);
2526
}
27+
).success(
28+
function (response) {
29+
var clearData = {
30+
'selectedShippingAddress': null,
31+
'shippingAddressFromData': null,
32+
'newCustomerShippingAddress': null,
33+
'selectedShippingRate': null,
34+
'selectedPaymentMethod': null,
35+
'selectedBillingAddress': null,
36+
'billingAddressFromData': null,
37+
'newCustomerBillingAddress': null
38+
};
39+
40+
if (response.responseType !== 'error') {
41+
customerData.set('checkout-data', clearData);
42+
}
43+
}
2644
).always(
2745
function () {
2846
fullScreenLoader.stopLoader();

0 commit comments

Comments
 (0)