Merge pull request #1419 from prashant-webkul/development

Rogue statement found in discount amount initialization
This commit is contained in:
Jitendra Singh 2019-09-07 16:52:48 +05:30 committed by GitHub
commit 7d53452bd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ class CartRuleDataGrid extends DataGrid
$this->addColumn([
'index' => 'disc_amount',
'label' => 'Quantity',
'label' => 'Discount Amount',
'type' => 'number',
'searchable' => false,
'sortable' => true,

View File

@ -66,10 +66,10 @@ class PercentOfProduct extends Action
if ($rule->disc_amount > 100) {
$discount_amount = 100;
} else {
$discount_amount = 100;
$discount_amount = $rule->disc_amount;
}
$discount = round(($itemPrice * $discount_amount) / 100, 4) * $discQuantity;
$discount = $itemPrice * ($discount_amount / 100) * $discQuantity;
$discount = $discount <= $itemPrice * $discQuantity ? $discount : $itemPrice * $discQuantity;