I am making a shipping extension. All the things works great but one thing no.

My collectRates function who is responsible to show all shipping methods on the frontend is checking all.


 * @param RateRequest $request
 * @return bool|Result
public function collectRates(RateRequest $request)
    if (!$this->getConfigFlag('active')) {
        return false;

    // $method->setCarrierTitle($this->getConfigData('title'));
    // $method->setMethodTitle($this->getConfigData('name'));

    /** @var \Magento\Shipping\Model\Rate\Result $result */
    $result = $this->_rateResultFactory->create();

    /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */

    $listaObjetosFrete = array();
    $listaObjetosFrete = $this->obterListaObjetosFrete($request)->data;

    foreach($listaObjetosFrete as $objetoFrete){

        $method = $this->_rateMethodFactory->create();






    return $result;

Checkout page who shows all shipping methods:

enter image description here

1 Answer 1



The code was the same..


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.