Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #13319 , Incorrect method return value in \Magento\Shipping\Model\Carrier\AbstractCarrier::getTotalNumOfBoxes() #20898

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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