Skip to content

Commit 1e6f09c

Browse files
MC-36088: Non-relevant shipping method available for checkout
1 parent ddf3c62 commit 1e6f09c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

app/code/Magento/Checkout/Model/ShippingInformationManagement.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ public function saveAddressInformation(
209209
if (!$quote->getIsVirtual()
210210
&& !$shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod())
211211
) {
212-
throw new NoSuchEntityException(
212+
$errorMessage = $methodCode ?
213213
__('Carrier with such method not found: %1, %2', $carrierCode, $methodCode)
214+
: __('The shipping method is missing. Select the shipping method and try again.');
215+
throw new NoSuchEntityException(
216+
$errorMessage
214217
);
215218
}
216219

app/code/Magento/Checkout/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,4 @@ Payment,Payment
185185
"Close","Close"
186186
"Show Cross-sell Items in the Shopping Cart","Show Cross-sell Items in the Shopping Cart"
187187
"You added %1 to your <a href=""%2"">shopping cart</a>.","You added %1 to your <a href=""%2"">shopping cart</a>."
188+
"The shipping method is missing. Select the shipping method and try again.","The shipping method is missing. Select the shipping method and try again."

app/code/Magento/Checkout/view/frontend/web/template/shipping-address/shipping-method-item.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
attr="'aria-labelledby': 'label_method_' + method.method_code + '_' + method.carrier_code + ' ' + 'label_carrier_' + method.method_code + '_' + method.carrier_code,
1616
'checked': element.rates().length == 1 || element.isSelected" />
1717
</td>
18+
<!-- ko ifnot: (method.error_message) -->
1819
<td class="col col-price">
1920
<each args="element.getRegion('price')" render="" />
2021
</td>
22+
<!-- /ko -->
2123
<td class="col col-method"
2224
attr="'id': 'label_method_' + method.method_code + '_' + method.carrier_code"
2325
text="method.method_title" />

0 commit comments

Comments
 (0)