magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

I Found error "Carrier with such method not found: international, international" on checkout page #13594

Closed ashokbhati180 closed 6 years ago

ashokbhati180 commented 6 years ago

when user is logged in and save shipping address in my account for US country which is selected by default in checkout page and when user select shipping method free international shippig from cart and go to checkout then this error occure. how to resolve it. error

magento-engcom-team commented 6 years ago

@ashokbhati180 thank you for your report. We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation or latest release.

magento-engcom-team commented 6 years ago

@ashokbhati180, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

maximehuran commented 6 years ago

I have this Exception sometimes, but I have no step to reproduce that actually. To avoid that I changed the logic of Magento\Checkout\Model\ShippingInformationManagement::saveAddressInformation with my own class (With a preference). Before throw the exception, I recollect shipping rates to be sure they are correct (Because in my case they are not) :

 if (!$shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod())) {
            // Try to recollect shipping rates in this case before to throw NoSuchEntityException
            $quote->getShippingAddress()->setCollectShippingRates(true)->collectShippingRates();
            if (!$shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod())) {
                throw new NoSuchEntityException(
                    __('Carrier with such method not found: %1, %2', $carrierCode, $methodCode)
                );
            }
        }
versdivers commented 6 years ago

thanks for the tip @maximehuran

sylvainraye commented 5 years ago

Got the same issue on Magento 2.2.3. It was related to a third party module (Fooman_Surcharge) the quote was defined to trigger a recollect on load into a collection. See \Magento\Quote\Model\Quote::setTriggerRecollect The problem I suppose is by doing that, it didn't collect the shipping rate correctly because the shipping method is missing or the opposite. I'm not sure exactly what happened with this setTriggerRecollect but after commenting it, the issue didn't came, however it provides an issue on Fooman_Surcharge module side.

The fix from @maximehuran worked for me.

PiroozMB commented 5 years ago

you always close issues leaving people with no solution. nice job

sylvainraye commented 5 years ago

To be fair enough regarding Magento contributors / team, for the Fooman Surcharge Module, the developer fixed it on his side. Magento itself should not be involved as it was an issue introduced by the third party module.

PiroozMB commented 5 years ago

@diglin I don't have any thirdparty module installed on my magento nor Fooman !!

sylvainraye commented 5 years ago

@PiroozMB ok, just wanted to speak and share about the case I met.

ashokbhati180 commented 5 years ago

thanks for the solution @maximehuran

imanasmage commented 5 years ago

@maximehuran - Not working. I'm using magento2.1.9 "message":"Carrier with such method not found: %1, %2","parameters":["matrixrate","matrixrate_57395"],"trace":"#0 [internal function]: Magento\\Checkout\\Model\\ShippingInformationManagement->saveAddressInformation(18678, Object(Magento\\Checkout\\Model\\ShippingInformation))\n#1 \/home\/apps2\/public_html\/vendor\/magento\/module-webapi\/Controller\/Rest.php(307): call_user_func_array(Array, Array)\n#2 \/home\/apps2\/public_html\/vendor\/magento\/module-webapi\/Controller\/Rest.php(216): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#3 \/home\/apps2\/public_html\/var\/generation\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(24): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#4 \/home\/apps2\/public_html\/vendor\/magento\/framework\/App\/Http.php(135): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#5 \/home\/apps2\/public_html\/vendor\/magento\/framework\/App\/Bootstrap.php(258): Magento\\Framework\\App\\Http->launch()\n#6 \/home\/apps2\/public_html\/index.php(40): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\n#7 {main}"}

rathodsunny005 commented 5 years ago

I'm also facing the same issue

ERajkumar commented 5 years ago

HI @magento-engcom-team I am also facing same issue

Magento 2.2.4

    {
    "message": "Carrier with such method not found: %1, %2",
    "parameters": [
        "freeshipping",
        "freeshipping"
    ],
    "trace": "#0 [internal function]: Magento\\Checkout\\Model\\ShippingInformationManagement->saveAddressInformation(3545, Object(Magento\\Checkout\\Model\\ShippingInformation))\n#1 \/var\/www\/html\/vendor\/magento\/module-webapi\/Controller\/Rest.php(330): call_user_func_array(Array, Array)\n#2 \/var\/www\/html\/vendor\/magento\/module-webapi\/Controller\/Rest.php(239): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#3 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#4 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#5 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#6 \/var\/www\/html\/generated\/code\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(26): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#7 \/var\/www\/html\/vendor\/magento\/framework\/App\/Http.php(135): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#8 \/var\/www\/html\/vendor\/magento\/framework\/App\/Bootstrap.php(256): Magento\\Framework\\App\\Http->launch()\n#9 \/var\/www\/html\/pub\/index.php(37): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#10 {main}"
    }
rathodsunny005 commented 5 years ago

Try to disabled all 3rd party Shipping extension and try again.

On Sat, Aug 10, 2019, 7:16 PM ERajkumar notifications@github.com wrote:

HI @magento-engcom-team https://github.com/magento-engcom-team I am also facing same issue

Magento 2.2.4

{
"message": "Carrier with such method not found: %1, %2",
"parameters": [
    "freeshipping",
    "freeshipping"
],
"trace": "#0 [internal function]: Magento\\Checkout\\Model\\ShippingInformationManagement->saveAddressInformation(3545, Object(Magento\\Checkout\\Model\\ShippingInformation))\n#1 \/var\/www\/html\/vendor\/magento\/module-webapi\/Controller\/Rest.php(330): call_user_func_array(Array, Array)\n#2 \/var\/www\/html\/vendor\/magento\/module-webapi\/Controller\/Rest.php(239): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#3 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#4 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#5 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#6 \/var\/www\/html\/generated\/code\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(26): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#7 \/var\/www\/html\/vendor\/magento\/framework\/App\/Http.php(135): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#8 \/var\/www\/html\/vendor\/magento\/framework\/App\/Bootstrap.php(256): Magento\\Framework\\App\\Http->launch()\n#9 \/var\/www\/html\/pub\/index.php(37): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#10 {main}"
}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/13594?email_source=notifications&email_token=ABYRPZDS7UEDBW7AHO2WGULQD3BBVA5CNFSM4EQDJEU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ANZUA#issuecomment-520150224, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYRPZFFPIGQETS7ITNFC2TQD3BBVANCNFSM4EQDJEUQ .

Digiraf commented 4 years ago

Try to disabled all 3rd party Shipping extension and try again. On Sat, Aug 10, 2019, 7:16 PM ERajkumar @.***> wrote: HI @magento-engcom-team https://github.com/magento-engcom-team I am also facing same issue Magento 2.2.4 { "message": "Carrier with such method not found: %1, %2", "parameters": [ "freeshipping", "freeshipping" ], "trace": "#0 [internal function]: Magento\Checkout\Model\ShippingInformationManagement->saveAddressInformation(3545, Object(Magento\Checkout\Model\ShippingInformation))\n#1 \/var\/www\/html\/vendor\/magento\/module-webapi\/Controller\/Rest.php(330): call_user_func_array(Array, Array)\n#2 \/var\/www\/html\/vendor\/magento\/module-webapi\/Controller\/Rest.php(239): Magento\Webapi\Controller\Rest->processApiRequest()\n#3 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#4 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->callParent('dispatch', Array)\n#5 \/var\/www\/html\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#6 \/var\/www\/html\/generated\/code\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(26): Magento\Webapi\Controller\Rest\Interceptor->callPlugins('dispatch', Array, Array)\n#7 \/var\/www\/html\/vendor\/magento\/framework\/App\/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#8 \/var\/www\/html\/vendor\/magento\/framework\/App\/Bootstrap.php(256): Magento\Framework\App\Http->launch()\n#9 \/var\/www\/html\/pub\/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#10 {main}" } — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#13594?email_source=notifications&email_token=ABYRPZDS7UEDBW7AHO2WGULQD3BBVA5CNFSM4EQDJEU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ANZUA#issuecomment-520150224>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYRPZFFPIGQETS7ITNFC2TQD3BBVANCNFSM4EQDJEUQ .

Really?

aloupfor commented 4 years ago

I comment on this issue as I was facing an error :

Carrier with such method not found

and 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.

I do not know what was wrong with those rules but I know that they were imported from a Magento 1 environment.

rathodsunny005 commented 4 years ago

This is not good practice to modify Magento core file. so try to debug more and reach the proper solution. if you still not found anything you can contact me.

RiteshSrivastava90 commented 4 years ago

{ "message": "Carrier with such method not found: %1, %2", "parameters": [ "freeshipping", "freeshipping" ], new user register this error come on checkout page

ray-moncada commented 2 years ago

{ "message": "Carrier with such method not found: %1, %2", "parameters": [ "freeshipping", "freeshipping" ], new user register this error come on checkout page

@ERajkumar @RiteshSrivastava90 @Digiraf

If anyone comes across the freeshipping issue. Carefully review any cart price rules or catalog price rules and make sure that the free shipping is not set to "No"