Skip to content

Commit 746a874

Browse files
MAGETWO-96850: [2.3.x] One page Checkout resets Customer data if Product Qty was changed
- Changed the logic of getting checkout data
1 parent f3b4f55 commit 746a874

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

app/code/Magento/Checkout/view/frontend/web/js/checkout-data.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ define([
2424
storage.set(cacheKey, data);
2525
},
2626

27+
/**
28+
* @return {*}
29+
*/
30+
initData = function () {
31+
return {
32+
'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage
33+
'shippingAddressFromData': null, //Shipping address pulled from persistence storage
34+
'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for customer
35+
'selectedShippingRate': null, //Shipping rate pulled from persistence storage
36+
'selectedPaymentMethod': null, //Payment method pulled from persistence storage
37+
'selectedBillingAddress': null, //Selected billing address pulled from persistence storage
38+
'billingAddressFromData': null, //Billing address pulled from persistence storage
39+
'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer
40+
}
41+
},
42+
2743
/**
2844
* @return {*}
2945
*/
@@ -32,26 +48,14 @@ define([
3248

3349
if ($.isEmptyObject(data)) {
3450
data = $.initNamespaceStorage('mage-cache-storage').localStorage.get(cacheKey);
51+
3552
if ($.isEmptyObject(data)) {
3653
data = initData();
3754
saveData(data);
3855
}
3956
}
4057

4158
return data;
42-
},
43-
44-
initData = function () {
45-
return {
46-
'selectedShippingAddress': null, //Selected shipping address pulled from persistence storage
47-
'shippingAddressFromData': null, //Shipping address pulled from persistence storage
48-
'newCustomerShippingAddress': null, //Shipping address pulled from persistence storage for customer
49-
'selectedShippingRate': null, //Shipping rate pulled from persistence storage
50-
'selectedPaymentMethod': null, //Payment method pulled from persistence storage
51-
'selectedBillingAddress': null, //Selected billing address pulled from persistence storage
52-
'billingAddressFromData': null, //Billing address pulled from persistence storage
53-
'newCustomerBillingAddress': null //Billing address pulled from persistence storage for new customer
54-
}
5559
};
5660

5761
return {

0 commit comments

Comments
 (0)