Skip to content
Snippets Groups Projects
Commit 12bbd395 authored by Olexii Korshenko's avatar Olexii Korshenko
Browse files

MAGETWO-38611: No validation message is shipping rate is not set

parent 6e376c6c
Branches
No related merge requests found
...@@ -69,6 +69,7 @@ define( ...@@ -69,6 +69,7 @@ define(
template: 'Magento_Checkout/shipping' template: 'Magento_Checkout/shipping'
}, },
visible: ko.observable(!quote.isVirtual()), visible: ko.observable(!quote.isVirtual()),
errorValidationMessage: ko.observable(false),
isCustomerLoggedIn: customer.isLoggedIn, isCustomerLoggedIn: customer.isLoggedIn,
isFormPopUpVisible: formPopUpState.isVisible, isFormPopUpVisible: formPopUpState.isVisible,
isFormInline: addressList().length == 0, isFormInline: addressList().length == 0,
...@@ -100,12 +101,16 @@ define( ...@@ -100,12 +101,16 @@ define(
stepNavigator.registerStep('shipping', 'Shipping', this.visible, 10); stepNavigator.registerStep('shipping', 'Shipping', this.visible, 10);
} }
this.isFormPopUpVisible.subscribe(function(value) { this.isFormPopUpVisible.subscribe(function (value) {
if (value) { if (value) {
self.getPopUp().openModal(); self.getPopUp().openModal();
} }
}); });
quote.shippingMethod.subscribe(function (value) {
self.errorValidationMessage(false);
});
return this; return this;
}, },
...@@ -195,7 +200,7 @@ define( ...@@ -195,7 +200,7 @@ define(
emailValidationResult = customer.isLoggedIn(); emailValidationResult = customer.isLoggedIn();
if (!quote.shippingMethod()) { if (!quote.shippingMethod()) {
alert($t('Please specify a shipping method')); this.errorValidationMessage('Please specify a shipping method');
return false; return false;
} }
......
...@@ -126,6 +126,11 @@ ...@@ -126,6 +126,11 @@
<!-- ko template: getTemplate() --><!-- /ko --> <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko --> <!-- /ko -->
</div> </div>
<!-- ko if: errorValidationMessage().length > 0 -->
<div class="message notice">
<span><!-- ko text: $t(errorValidationMessage())--><!-- /ko --></span>
</div>
<!-- /ko -->
<div class="actions-toolbar" id="shipping-method-buttons-container"> <div class="actions-toolbar" id="shipping-method-buttons-container">
<div class="primary"> <div class="primary">
<button data-role="opc-continue" type="submit" class="button action continue primary"> <button data-role="opc-continue" type="submit" class="button action continue primary">
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment