Skip to content

Commit

Permalink
Merge pull request #1078 from magento-engcom/2.1-develop-prs
Browse files Browse the repository at this point in the history
[EngCom] Public Pull Requests - 2.1

 - MAGETWO-68875: [Backport] Shipping method radios become disabled when checkout page refreshed #9485
  • Loading branch information
ishakhsuvarov authored May 3, 2017
2 parents e468e34 + 75e490c commit fa68470
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@ define([], function () {
* Returns new address object
*/
return function (addressData) {
var identifier = Date.now();
var identifier = Date.now(),
regionId;

if (addressData.region && addressData.region.region_id) {
regionId = addressData.region.region_id;
} else if (addressData.country_id && addressData.country_id == window.checkoutConfig.defaultCountryId) {
regionId = window.checkoutConfig.defaultRegionId || undefined;
}

return {
email: addressData.email,
countryId: addressData['country_id'] || addressData.countryId || window.checkoutConfig.defaultCountryId,
regionId: (addressData.region && addressData.region.region_id) ?
addressData.region.region_id
: window.checkoutConfig.defaultRegionId,
regionId: regionId || addressData.regionId,
regionCode: (addressData.region) ? addressData.region.region_code : null,
region: (addressData.region) ? addressData.region.region : null,
customerId: addressData.customer_id,
customerId: addressData.customer_id || addressData.customerId,
street: addressData.street,
company: addressData.company,
telephone: addressData.telephone,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ define(
fieldsetName = 'checkout.steps.shipping-step.shippingAddress.shipping-address-fieldset';

this._super();
shippingRatesValidator.initFields(fieldsetName);

if (!quote.isVirtual()) {
stepNavigator.registerStep(
Expand Down Expand Up @@ -120,6 +119,7 @@ define(
checkoutProvider.on('shippingAddress', function (shippingAddressData) {
checkoutData.setShippingAddressFromData(shippingAddressData);
});
shippingRatesValidator.initFields(fieldsetName);
});

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ define([], function() {
* Returns new address object
*/
return function (addressData) {
var regionId;

if (addressData.region['region_id'] && addressData.region['region_id'] !== '0') {
regionId = addressData.region['region_id'] + '';
}

return {
customerAddressId: addressData.id,
email: addressData.email,
countryId: addressData.country_id,
regionId: addressData.region_id,
regionId: regionId,
regionCode: addressData.region.region_code,
region: addressData.region.region,
customerId: addressData.customer_id,
Expand Down

0 comments on commit fa68470

Please sign in to comment.