Skip to content

Commit

Permalink
Merge pull request #32 from niclashoyer/patch-1
Browse files Browse the repository at this point in the history
Fix productAmount calculation
  • Loading branch information
sydekumf authored Aug 31, 2018
2 parents 9b5d703 + 98fcd1a commit 3b073f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ public function getBasePrice(Product $product)
$productAmount = $product->getData('baseprice_product_amount');

$basePrice = 0;
if ($productPrice && $conversion && $referenceAmount && $productAmount) {
if ($productPrice && $conversion && $referenceAmount && $productAmount && $productAmount > 0) {
$basePrice = $productPrice * $conversion * $referenceAmount / $productAmount;
}

return $basePrice;
}
}
}

0 comments on commit 3b073f1

Please sign in to comment.