Skip to content
Snippets Groups Projects
Commit f3c166d1 authored by Christel Loftus's avatar Christel Loftus
Browse files

add to fetch rates

parent d2749f7f
No related branches found
Tags 1.0.19
1 merge request!6Rates at checkout
Pipeline #65214 passed
......@@ -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')];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment