Added checks for discount and flat case

This commit is contained in:
Jaseel P V 2020-10-13 22:37:02 +05:30
parent 67acbc8b99
commit b96e45a8e1
1 changed files with 6 additions and 4 deletions

View File

@ -660,13 +660,15 @@ abstract class AbstractType
}
if ($price->value_type == 'discount') {
$lastPrice = $product->price - ($product->price * $price->value) / 100;
if ($price->value >= 0 && $price->value <= 100) {
$lastPrice = $product->price - ($product->price * $price->value) / 100;
$lastQty = $price->qty;
$lastQty = $price->qty;
$lastCustomerGroupId = $price->customer_group_id;
$lastCustomerGroupId = $price->customer_group_id;
}
} else {
if ($price->value < $lastPrice) {
if ($price->value >= 0 && $price->value < $lastPrice) {
$lastPrice = $price->value;
$lastQty = $price->qty;