Skip to content

Commit 56504e1

Browse files
author
Mudit Shukla
authored
Updated AbstractCarrier.php
Fixed #13319 , added type casting and updated function comment..
1 parent 2957731 commit 56504e1

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)