- /**
- * Collect rates by address
- *
- * @param \Magento\Framework\DataObject $address
- * @param null|bool|array $limitCarrier
- * @return $this
- */
- public function collectRatesByAddress(\Magento\Framework\DataObject $address, $limitCarrier = null)
- {
- /** @var $request \Magento\Quote\Model\Quote\Address\RateRequest */
- $request = $this->_shipmentRequestFactory->create();
- $request->setAllItems($address->getAllItems());
- $request->setDestCountryId($address->getCountryId());
- $request->setDestRegionId($address->getRegionId());
- $request->setDestPostcode($address->getPostcode());
- $request->setPackageValue($address->getBaseSubtotal());
- $request->setPackageValueWithDiscount($address->getBaseSubtotalWithDiscount());
- $request->setPackageWeight($address->getWeight());