15

When I'm on Checkout Page. Sometimes I'm facing the below error.

Carrier with such method not found: null, null

I have selected by Shipping Address, Not selected any Shipping Method & Clicked on "Next"

I'm using DHL Shipping Method. I have to override the DHL Shipping Method Model as per my requirement.

Magento 2: How to change Weight field for DHL Shipping Method [SOLVED]

Not sure if anyone comes across this issue.

3
  • I'm having this issue as well.. Haven't found a fix for it yet. Clicking "Next" again for the second time works. It's just the first time..
    – Erfan
    Commented Aug 21, 2017 at 4:03
  • Have you found any solution @Erfan Commented Sep 7, 2017 at 17:56
  • Yeah, @Jalpesh, for me it was because of a collectTotals call in a custom plugin (after quote load). We made sure it only collects totals when it needs, and it fixed a lot of issues for us.
    – Erfan
    Commented Sep 8, 2017 at 7:59

3 Answers 3

0

This solution might work for this issue (override collectRates() method and set the correct shipping method to quote shipping address) - https://stackoverflow.com/a/64826863/8497354

FYI - Possible M2 core issues:

Cheers!

0

The above error is triggered when the specified shipping method is not available or is invalid.

As we can see at vendor/magento/module-checkout/Model/ShippingInformationManagement.php:209 if getShippingRateByCode returns false, it throws this exception.

Inside this method, we can see that it's not very complex to understand...

    public function getShippingRateByCode($code)
    {
        foreach ($this->getShippingRatesCollection() as $rate) {
            if ($rate->getCode() == $code) {
                return $rate;
            }
        }

        return false;
    }

I can think of 3 possible reasons for that:

  1. You have a saved quote using a shipping method that was disabled
  2. When you changed the shipping method, you forgot to add the constant CODE or changed its value
  3. You've changed the config.xml of the module and forgot to add <model> within the default node. I did that once for the payment method and got a similar error.

I hope any of these suggestions help.

0

Please refers to doc: https://github.com/magento/magento2/issues/13594

As per doc, with step by step debug, I was able to trace the problem from:

// magento/vendor/magento/module-quote/Model/Quote/ShippingAssignment/ShippingProcessor.php:72
$this->shippingMethodManagement->apply($quote->getId(), $carrierCode, $methodCode);

to:

// magento/vendor/magento/module-sales-rule/Model/Validator.php:374
foreach ($this->_getRules($address) as $rule) {

I updated is_active field to 0 to rules retrieved by request (that I got by using $this->_getRules($address)->getSelectSql(true)) in salesrule table.

I was then able to reach payment step.

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.