Skip to content

Commit

Permalink
ENGCOM-4147: Fixed #13319 , Incorrect method return value in \Magento…
Browse files Browse the repository at this point in the history
…\Shipping\Model\Carrier\AbstractCarrier::getTotalNumOfBoxes() #20898

 - Merge Pull Request #20898 from cedmudit/magento2:2.3-developpr13319
 - Merged commits:
   1. 56504e1
  • Loading branch information
magento-engcom-team committed Feb 6, 2019
2 parents 8dfe26a + 56504e1 commit 343c06a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,10 @@ protected function _getPerorderPrice($cost, $handlingType, $handlingFee)
}

/**
* Sets the number of boxes for shipping
* Gets the average weight of each box available for shipping
*
* @param int $weight in some measure
* @return int
* @param float $weight in some measure
* @return float
*/
public function getTotalNumOfBoxes($weight)
{
Expand All @@ -545,7 +545,7 @@ public function getTotalNumOfBoxes($weight)
$maxPackageWeight = $this->getConfigData('max_package_weight');
if ($weight > $maxPackageWeight && $maxPackageWeight != 0) {
$this->_numBoxes = ceil($weight / $maxPackageWeight);
$weight = $weight / $this->_numBoxes;
$weight = (float)$weight / $this->_numBoxes;
}

return $weight;
Expand Down

0 comments on commit 343c06a

Please sign in to comment.