Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function collectRates(RateRequest $request)
- {
- // Check if postcode is allowed
- if (!$this->isActive() || !$this->postcodeValidate($request->getDestPostcode()))
- {
- return false;
- }
- $result = $this->_rateResultFactory->create();
- $shippingPrice = $this->getConfigData('price');
- $method = $this->_rateMethodFactory->create();
- $method->setCarrier($this->getCarrierCode());
- $method->setCarrierTitle($this->getConfigData('title'));
- $method->setMethod($this->getCarrierCode());
- $method->setMethodTitle($this->getConfigData('name'));
- $method->setPrice($shippingPrice);
- $method->setCost($shippingPrice);
- $result->append($method);
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement