Skip to content

Commit 343c06a

Browse files
ENGCOM-4147: Fixed #13319 , Incorrect method return value in \Magento\Shipping\Model\Carrier\AbstractCarrier::getTotalNumOfBoxes() #20898
- Merge Pull Request #20898 from cedmudit/magento2:2.3-developpr13319 - Merged commits: 1. 56504e1
2 parents 8dfe26a + 56504e1 commit 343c06a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,10 @@ protected function _getPerorderPrice($cost, $handlingType, $handlingFee)
531531
}
532532

533533
/**
534-
* Sets the number of boxes for shipping
534+
* Gets the average weight of each box available for shipping
535535
*
536-
* @param int $weight in some measure
537-
* @return int
536+
* @param float $weight in some measure
537+
* @return float
538538
*/
539539
public function getTotalNumOfBoxes($weight)
540540
{
@@ -545,7 +545,7 @@ public function getTotalNumOfBoxes($weight)
545545
$maxPackageWeight = $this->getConfigData('max_package_weight');
546546
if ($weight > $maxPackageWeight && $maxPackageWeight != 0) {
547547
$this->_numBoxes = ceil($weight / $maxPackageWeight);
548-
$weight = $weight / $this->_numBoxes;
548+
$weight = (float)$weight / $this->_numBoxes;
549549
}
550550

551551
return $weight;

0 commit comments

Comments
 (0)