Skip to content

Commit b5ddd2a

Browse files
committed
MAGETWO-55117: ShippingMethodManagement::estimateByAddressId set not full address details
- fixing logic as address won't be null
1 parent 6cd2dc4 commit b5ddd2a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

app/code/Magento/Quote/Model/ShippingMethodManagement.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,7 @@ public function estimateByAddress($cartId, \Magento\Quote\Api\Data\EstimateAddre
202202
return [];
203203
}
204204

205-
return $this->getShippingMethods(
206-
$quote,
207-
$address
208-
);
205+
return $this->getShippingMethods($quote, $address);
209206
}
210207

211208
/**
@@ -273,16 +270,14 @@ protected function getEstimatedRates(
273270
/**
274271
* Get list of available shipping methods
275272
* @param \Magento\Quote\Model\Quote $quote
276-
* @param \Magento\Framework\Api\ExtensibleDataInterface|null $address
273+
* @param \Magento\Framework\Api\ExtensibleDataInterface $address
277274
* @return \Magento\Quote\Api\Data\ShippingMethodInterface[]
278275
*/
279276
private function getShippingMethods(Quote $quote, $address)
280277
{
281278
$output = [];
282279
$shippingAddress = $quote->getShippingAddress();
283-
if ($address) {
284-
$shippingAddress->addData($this->extractAddressData($address));
285-
}
280+
$shippingAddress->addData($this->extractAddressData($address));
286281
$shippingAddress->setCollectShippingRates(true);
287282

288283
$this->totalsCollector->collectAddressTotals($quote, $shippingAddress);

0 commit comments

Comments
 (0)