Skip to content

Commit

Permalink
fix: fix division by zero issue on checkout (#746)
Browse files Browse the repository at this point in the history
Co-authored-by: Igor Alekseenko <igor@cream.nl>
  • Loading branch information
2 people authored and EdieLemoine committed Feb 2, 2023
1 parent 721259a commit cee3094
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Model/Sales/Repository/PackageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function selectPackageType(array $products, string $carrierPath): string
$digitalStamp = true;
foreach ($products as $product) {
$productQty = $product->getQty();
$productWeight = $product->getWeight();
$productWeight = (float) $product->getWeight();

if ($productQty < 1) {
continue;
Expand All @@ -61,7 +61,7 @@ public function selectPackageType(array $products, string $carrierPath): string
}

$mailboxQty = $this->getAttributesProductsOptions($product, 'fit_in_mailbox');
if (0 === $mailboxQty && 0 !== $productWeight) {
if (0 === $mailboxQty && 0.0 !== $productWeight) {
$mailboxQty = (int) ($this->getMaxMailboxWeight() / $productWeight);
}

Expand Down

0 comments on commit cee3094

Please sign in to comment.