Skip to content

Commit 47a8826

Browse files
committed
Merge remote-tracking branch 'magento-tango/MC-21876' into MPI-PR-2019-10-18
2 parents 7aece94 + ea16329 commit 47a8826

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,11 @@ protected function _populateBeforeSaveData()
425425
*/
426426
protected function _isSameAsBilling()
427427
{
428+
$quoteSameAsBilling = $this->getSameAsBilling();
429+
428430
return $this->getAddressType() == \Magento\Quote\Model\Quote\Address::TYPE_SHIPPING &&
429-
($this->_isNotRegisteredCustomer() ||
430-
$this->_isDefaultShippingNullOrSameAsBillingAddress());
431+
($this->_isNotRegisteredCustomer() || $this->_isDefaultShippingNullOrSameAsBillingAddress()) &&
432+
($quoteSameAsBilling || $quoteSameAsBilling === 0 || $quoteSameAsBilling === null);
431433
}
432434

433435
/**
@@ -471,7 +473,7 @@ protected function _isDefaultShippingNullOrSameAsBillingAddress()
471473
/**
472474
* Declare address quote model object
473475
*
474-
* @param \Magento\Quote\Model\Quote $quote
476+
* @param \Magento\Quote\Model\Quote $quote
475477
* @return $this
476478
*/
477479
public function setQuote(\Magento\Quote\Model\Quote $quote)
@@ -691,7 +693,7 @@ public function getItemQty($itemId = 0)
691693
*/
692694
public function hasItems()
693695
{
694-
return sizeof($this->getAllItems()) > 0;
696+
return count($this->getAllItems()) > 0;
695697
}
696698

697699
/**
@@ -1225,8 +1227,8 @@ public function setBaseShippingAmount($value, $alreadyExclTax = false)
12251227
/**
12261228
* Set total amount value
12271229
*
1228-
* @param string $code
1229-
* @param float $amount
1230+
* @param string $code
1231+
* @param float $amount
12301232
* @return $this
12311233
*/
12321234
public function setTotalAmount($code, $amount)
@@ -1243,8 +1245,8 @@ public function setTotalAmount($code, $amount)
12431245
/**
12441246
* Set total amount value in base store currency
12451247
*
1246-
* @param string $code
1247-
* @param float $amount
1248+
* @param string $code
1249+
* @param float $amount
12481250
* @return $this
12491251
*/
12501252
public function setBaseTotalAmount($code, $amount)
@@ -1261,8 +1263,8 @@ public function setBaseTotalAmount($code, $amount)
12611263
/**
12621264
* Add amount total amount value
12631265
*
1264-
* @param string $code
1265-
* @param float $amount
1266+
* @param string $code
1267+
* @param float $amount
12661268
* @return $this
12671269
*/
12681270
public function addTotalAmount($code, $amount)
@@ -1276,8 +1278,8 @@ public function addTotalAmount($code, $amount)
12761278
/**
12771279
* Add amount total amount value in base store currency
12781280
*
1279-
* @param string $code
1280-
* @param float $amount
1281+
* @param string $code
1282+
* @param float $amount
12811283
* @return $this
12821284
*/
12831285
public function addBaseTotalAmount($code, $amount)

0 commit comments

Comments
 (0)