Skip to content

Commit b554d2b

Browse files
author
Oleksii Korshenko
committed
Merge remote-tracking branch 'origin/bugfix' into magento2
2 parents c528a06 + 96fec15 commit b554d2b

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

app/code/Magento/Checkout/view/frontend/web/js/action/select-billing-address.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ define(
88
'jquery',
99
'../model/quote'
1010
],
11-
function($, quote) {
12-
"use strict";
13-
return function(billingAddress) {
11+
function ($, quote) {
12+
'use strict';
13+
14+
return function (billingAddress) {
1415
var address = null;
16+
1517
if (quote.shippingAddress() && billingAddress.getCacheKey() == quote.shippingAddress().getCacheKey()) {
1618
address = $.extend({}, billingAddress);
1719
address.saveInAddressBook = false;
18-
if (quote.shippingAddress().saveInAddressBook || quote.shippingAddress().save_in_address_book) {
19-
address.saveInAddressBook = true;
20-
quote.shippingAddress().saveInAddressBook = false;
21-
}
2220
} else {
2321
address = billingAddress;
2422
}

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-save-processor/default.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,47 @@
66
define(
77
[
88
'ko',
9-
'jquery',
109
'Magento_Checkout/js/model/quote',
1110
'Magento_Checkout/js/model/resource-url-manager',
1211
'mage/storage',
1312
'Magento_Checkout/js/model/payment-service',
1413
'Magento_Checkout/js/model/payment/method-converter',
1514
'Magento_Checkout/js/model/error-processor',
16-
'Magento_Checkout/js/model/full-screen-loader'
15+
'Magento_Checkout/js/model/full-screen-loader',
16+
'Magento_Checkout/js/action/select-billing-address'
1717
],
1818
function (
1919
ko,
20-
$,
2120
quote,
2221
resourceUrlManager,
2322
storage,
2423
paymentService,
2524
methodConverter,
2625
errorProcessor,
27-
fullScreenLoader
26+
fullScreenLoader,
27+
selectBillingAddressAction
2828
) {
2929
'use strict';
30+
3031
return {
31-
saveShippingInformation: function() {
32-
var billingAddress = quote.billingAddress();
33-
if (!billingAddress) {
34-
billingAddress = $.extend({}, quote.shippingAddress());
35-
quote.billingAddress(billingAddress);
36-
quote.shippingAddress().sameAsBilling = 1;
32+
saveShippingInformation: function () {
33+
var payload;
34+
35+
if (!quote.billingAddress()) {
36+
selectBillingAddressAction(quote.shippingAddress());
3737
}
38-
var payload = {
38+
39+
payload = {
3940
addressInformation: {
4041
shipping_address: quote.shippingAddress(),
41-
billing_address: billingAddress,
42+
billing_address: quote.billingAddress(),
4243
shipping_method_code: quote.shippingMethod().method_code,
4344
shipping_carrier_code: quote.shippingMethod().carrier_code
4445
}
4546
};
4647

4748
fullScreenLoader.startLoader();
49+
4850
return storage.post(
4951
resourceUrlManager.getUrlForSetShippingInformation(quote),
5052
JSON.stringify(payload)

app/code/Magento/Tax/etc/config.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<defaults>
2727
<country>US</country>
2828
<region>0</region>
29-
<postcode>*</postcode>
3029
</defaults>
3130
<display>
3231
<type>1</type>

0 commit comments

Comments
 (0)