Skip to content

"Please specify a shipping method" Exception #5021

Closed
@vphat28

Description

@vphat28

Steps to reproduce

  1. Install Magento from develop branch.
  2. Install 3rd test shipping provider
  3. Able to show rate in checkout page
  4. Able to choose payment methods
  5. Click on "Place order"
  6. Exception is throwed "Please specify a shipping method"

Expected result

  1. Should go to success page

Actual result

  1. Exception is throwed "Please specify a shipping method"

I searched for the string and in file \vendor\magento\module-quote\Model\QuoteValidator.php line 53
the $method variable is null

My collectrates in shipping adapter is
$method = $this->_rateMethodFactory->create();

        $method->setCarrier($this->_code);
        $method->setCarrierTitle($this->getConfigData('name'));

        $method->setMethod('express_method');
        $method->setMethodTitle($this->getConfigData('express_title'));

        $method->setPrice($this->getConfigData('express_price'));
        $method->setCost($this->getConfigData('express_price'));

        $result->append($method);

I noticed that when I remove the underscore symple and change $method->setMethod('express_method'); to $method->setMethod('expressmethod');
the checkout went through successfully.

I wonder can I use "_" symbol in function setmethod? I don't have this problem in magento 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: ShippingFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions