diff --git a/Model/Carrier/BobGo.php b/Model/Carrier/BobGo.php index d54a1f278b95a7be24dc0cec3f30c386786da96a..4482890ca9523d3a47ff26ba331b53e33b1523ec 100644 --- a/Model/Carrier/BobGo.php +++ b/Model/Carrier/BobGo.php @@ -1360,21 +1360,30 @@ class BobGo extends AbstractCarrier implements CarrierInterface if (!$this->getConfigFlag('active')) { return false; } - /** @var Method $method */ + + /** @var \Magento\Shipping\Model\Rate\Result $result */ + $result = $this->rateResultFactory->create(); + + /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */ $method = $this->rateMethodFactory->create(); + $method->setCarrier($this->_code); $method->setCarrierTitle($this->getConfigData('title')); + $method->setMethod($this->_code); $method->setMethodTitle($this->getConfigData('name')); - $shippingCost = (float)$this->getConfigData('shipping_cost'); + + $shippingCost = (float) $this->getConfigData('shipping_cost'); + $method->setPrice($shippingCost); $method->setCost($shippingCost); - /** @var Result $result */ - $result = $this->rateResultFactory->create(); + $result->append($method); + return $result; } + public function getAllowedMethods(): array { return [$this->_code => $this->getConfigData('name')];