Skip to content

Commit

Permalink
Updated AbstractCarrier.php
Browse files Browse the repository at this point in the history
Fixed #13319 , added type casting and updated function comment..
  • Loading branch information
Mudit Shukla authored Feb 3, 2019
1 parent 2957731 commit 56504e1
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 56504e1

Please sign in to comment.