Skip to content

Commit b685540

Browse files
committed
MAGETWO-59227: Customer Address/Customer attribute isn't validated if required
1 parent c533b3d commit b685540

File tree

1 file changed

+14
-7
lines changed
  • app/code/Magento/Checkout/view/frontend/web/js/view

1 file changed

+14
-7
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ define(
179179
newShippingAddress;
180180

181181
this.source.set('params.invalid', false);
182-
this.source.trigger('shippingAddress.data.validate');
182+
this.triggerShippingDataValidateEvent();
183183

184184
if (!this.source.get('params.invalid')) {
185185
addressData = this.source.get('shippingAddress');
@@ -254,12 +254,7 @@ define(
254254

255255
if (this.isFormInline) {
256256
this.source.set('params.invalid', false);
257-
this.source.trigger('shippingAddress.data.validate');
258-
259-
if (this.source.get('shippingAddress.custom_attributes')) {
260-
this.source.trigger('shippingAddress.custom_attributes.data.validate');
261-
}
262-
257+
this.triggerShippingDataValidateEvent();
263258
if (emailValidationResult &&
264259
this.source.get('params.invalid') ||
265260
!quote.shippingMethod().method_code ||
@@ -304,6 +299,18 @@ define(
304299
}
305300

306301
return true;
302+
},
303+
304+
/**
305+
* Trigger Shipping data Validate Event.
306+
*
307+
* @return {void}
308+
*/
309+
triggerShippingDataValidateEvent: function () {
310+
this.source.trigger('shippingAddress.data.validate');
311+
if (this.source.get('shippingAddress.custom_attributes')) {
312+
this.source.trigger('shippingAddress.custom_attributes.data.validate');
313+
}
307314
}
308315
});
309316
}

0 commit comments

Comments
 (0)