diff -Nuar a/vendor/magento/module-checkout/Model/ShippingInformationManagement.php b/vendor/magento/module-checkout/Model/ShippingInformationManagement.php index 369ae8e6f72..ae1599be5d3 100644 --- a/vendor/magento/module-checkout/Model/ShippingInformationManagement.php +++ b/vendor/magento/module-checkout/Model/ShippingInformationManagement.php @@ -194,8 +194,11 @@ class ShippingInformationManagement implements \Magento\Checkout\Api\ShippingInf if (!$quote->getIsVirtual() && !$shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod()) ) { - throw new NoSuchEntityException( + $errorMessage = $methodCode ? __('Carrier with such method not found: %1, %2', $carrierCode, $methodCode) + : __('The shipping method is missing. Select the shipping method and try again.'); + throw new NoSuchEntityException( + $errorMessage ); } diff -Nuar a/vendor/magento/module-checkout/i18n/en_US.csv b/vendor/magento/module-checkout/i18n/en_US.csv index 251985faf6c..e4f3c7f951d 100644 --- a/vendor/magento/module-checkout/i18n/en_US.csv +++ b/vendor/magento/module-checkout/i18n/en_US.csv @@ -182,4 +182,5 @@ Payment,Payment "Items in Cart","Items in Cart" "Close","Close" "Show Cross-sell Items in the Shopping Cart","Show Cross-sell Items in the Shopping Cart" -"You added %1 to your shopping cart.","You added %1 to your shopping cart." \ No newline at end of file +"You added %1 to your shopping cart.","You added %1 to your shopping cart." +"The shipping method is missing. Select the shipping method and try again.","The shipping method is missing. Select the shipping method and try again." \ No newline at end of file diff -Nuar a/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js b/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js index 1c3f38a37c7..e1c78944862 100644 --- a/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js +++ b/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js @@ -298,6 +298,12 @@ define([ this.source.set('params.invalid', false); this.triggerShippingDataValidateEvent(); + if (!quote.shippingMethod()['method_code']) { + this.errorValidationMessage( + $t('The shipping method is missing. Select the shipping method and try again.') + ); + } + if (emailValidationResult && this.source.get('params.invalid') || !quote.shippingMethod()['method_code'] || diff -Nuar a/vendor/magento/module-checkout/view/frontend/web/template/shipping-address/shipping-method-item.html b/vendor/magento/module-checkout/view/frontend/web/template/shipping-address/shipping-method-item.html index 11e41905458..fd6be02657e 100644 --- a/vendor/magento/module-checkout/view/frontend/web/template/shipping-address/shipping-method-item.html +++ b/vendor/magento/module-checkout/view/frontend/web/template/shipping-address/shipping-method-item.html @@ -15,9 +15,11 @@ attr="'aria-labelledby': 'label_method_' + method.method_code + '_' + method.carrier_code + ' ' + 'label_carrier_' + method.method_code + '_' + method.carrier_code, 'checked': element.rates().length == 1 || element.isSelected" /> +