Skip to content

Commit b545997

Browse files
committed
#18990: Shipping address is not validated in checkout when proceeding step as logged in user with default shipping address
1 parent 43e2c4d commit b545997

File tree

1 file changed

+9
-8
lines changed
  • app/code/Magento/Checkout/view/frontend/web/js/view

1 file changed

+9
-8
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,8 @@ define([
266266
loginFormSelector = 'form[data-role=email-with-possible-login]',
267267
emailValidationResult = customer.isLoggedIn(),
268268
field,
269-
countryIndexedOptions = registry.get(
270-
this.parentName + '.shippingAddress.shipping-address-fieldset.country_id'
271-
).indexedOptions,
269+
country = registry.get(this.parentName + '.shippingAddress.shipping-address-fieldset.country_id'),
270+
countryIndexedOptions = country.indexedOptions,
272271
option = countryIndexedOptions[quote.shippingAddress().countryId],
273272
messageContainer = registry.get('checkout.errors').messageContainer;
274273

@@ -323,12 +322,14 @@ define([
323322
shippingAddress['save_in_address_book'] = 1;
324323
}
325324
selectShippingAddress(shippingAddress);
326-
} else if (customer.isLoggedIn()
327-
&& option
328-
&& option['is_region_required']
329-
&& !quote.shippingAddress().region
325+
} else if (customer.isLoggedIn() &&
326+
option &&
327+
option['is_region_required'] &&
328+
!quote.shippingAddress().region
330329
) {
331-
messageContainer.addErrorMessage({message: $t('Please specify a regionId in shipping address.')});
330+
messageContainer.addErrorMessage({
331+
message: $t('Please specify a regionId in shipping address.')
332+
});
332333

333334
return false;
334335
}

0 commit comments

Comments
 (0)