Skip to content

Commit

Permalink
magento#18990: Shipping address is not validated in checkout when pro…
Browse files Browse the repository at this point in the history
…ceeding step as logged in user with default shipping address
  • Loading branch information
StasKozar committed Nov 7, 2018
1 parent 43e2c4d commit b545997
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,8 @@ define([
loginFormSelector = 'form[data-role=email-with-possible-login]',
emailValidationResult = customer.isLoggedIn(),
field,
countryIndexedOptions = registry.get(
this.parentName + '.shippingAddress.shipping-address-fieldset.country_id'
).indexedOptions,
country = registry.get(this.parentName + '.shippingAddress.shipping-address-fieldset.country_id'),
countryIndexedOptions = country.indexedOptions,
option = countryIndexedOptions[quote.shippingAddress().countryId],
messageContainer = registry.get('checkout.errors').messageContainer;

Expand Down Expand Up @@ -323,12 +322,14 @@ define([
shippingAddress['save_in_address_book'] = 1;
}
selectShippingAddress(shippingAddress);
} else if (customer.isLoggedIn()
&& option
&& option['is_region_required']
&& !quote.shippingAddress().region
} else if (customer.isLoggedIn() &&
option &&
option['is_region_required'] &&
!quote.shippingAddress().region
) {
messageContainer.addErrorMessage({message: $t('Please specify a regionId in shipping address.')});
messageContainer.addErrorMessage({
message: $t('Please specify a regionId in shipping address.')
});

return false;
}
Expand Down

0 comments on commit b545997

Please sign in to comment.