0

We face a strange error in the checkout on the domain.com/checkout/#payment page, when clicking the place order button.

For some reason in some cases, we still can't find when exactly, the customer on checkout when clicking the place order button receive the error: The shipping method is missing. Select the shipping method and try again.

But we only have 1 active shipping method, the default "Flat Rate" method and is always select because it's the only value. And this issue can be solved by the customer, by moving back to the shipping step (domain.com/checkout/#shipping) and without any change directly go back to the payment step. Then clicking the place order button and it works perfectly.

We use a Cart Price Rule for free shipping, when the cart amount is above $50. Then the customer receive free shipping, otherwise the default Flate Rate is calculated.

Any idea what can cause this issue and how we can solve this? We run Magento 2.4.4, but we had this issue also on 2.4.3

2
  • Check your logs what you get, then decide how to debug. Commented Dec 14, 2022 at 13:14
  • @Oscprofessionals Thanks, but the problem is that we do not see any error in the log, except this specific error that his message was thrown.
    – JGeer
    Commented Dec 14, 2022 at 16:07

2 Answers 2

0

You can debug this issue on the below class (It might be extended in any custom module):

\Magento\Shipping\Model\Carrier\AbstractCarrier

Check if this class extended. There is a method collectRates(RateRequest $request) used in this class which is responsible for shipping methods and rates.

3
  • Thanks, we only have 1 custom module, based on this that extended this: developer.adobe.com/commerce/php/tutorials/frontend/… But our public function collectRates(RateRequest $request) always return false; And how is it possible that going 1 step back, it solves the issue after it?
    – JGeer
    Commented Dec 14, 2022 at 16:13
  • Can you disable that module for testing and check if that issue still persist. Commented Dec 14, 2022 at 16:17
  • Yes, sure, we can. But because collectRates always return false, it should not make any difference right?
    – JGeer
    Commented Dec 14, 2022 at 16:21
0

This error NoSuchEntityException thrown in below file Magento\Checkout\Model\ShippingInformationManagement on saveAddressInformation method for getting shipping method rate by method code,whereas any issue on collectRates function occurred then shipping method because unavailable and cause the issue.

!$shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod()
2
  • Thanks, but how can we debug this. Well we use a Cart Price Rule for free shipping above $50, forgot to add it earlier to the question. How can we debug this?
    – JGeer
    Commented Dec 14, 2022 at 16:06
  • Can you please add log as get_class_methods($method); before $result->append($method); and check the shipping price setting or not. Commented Dec 15, 2022 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.