Normalized cart action rules
This commit is contained in:
parent
5b33eb4a56
commit
cf5cc40acb
|
|
@ -92,7 +92,13 @@ class FixedAmount extends Action
|
|||
|
||||
$report['item_id'] = $item->id;
|
||||
$report['product_id'] = $item->child ? $item->child->product_id : $item->product_id;
|
||||
$report['discount'] = $discount;
|
||||
|
||||
if ($discount <= $itemPrice) {
|
||||
$report['discount'] = $discount;
|
||||
} else {
|
||||
$report['discount'] = $itemPrice;
|
||||
}
|
||||
|
||||
$report['formatted_discount'] = core()->currency($discount);
|
||||
|
||||
$impact->push($report);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,13 @@ class PercentOfProduct extends Action
|
|||
|
||||
$report['item_id'] = $item->id;
|
||||
$report['product_id'] = $item->child ? $item->child->product_id : $item->product_id;
|
||||
$report['discount'] = $discount;
|
||||
|
||||
if ($discount <= $itemPrice) {
|
||||
$report['discount'] = $discount;
|
||||
} else {
|
||||
$report['discount'] = $itemPrice;
|
||||
}
|
||||
|
||||
$report['formatted_discount'] = core()->currency($discount);
|
||||
|
||||
$impact->push($report);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,13 @@ class WholeCartToPercent extends Action
|
|||
|
||||
$report['item_id'] = $item->id;
|
||||
$report['product_id'] = $item->child ? $item->child->product_id : $item->product_id;
|
||||
$report['discount'] = $discount;
|
||||
|
||||
if ($discount <= $itemPrice) {
|
||||
$report['discount'] = $discount;
|
||||
} else {
|
||||
$report['discount'] = $itemPrice;
|
||||
}
|
||||
|
||||
$report['formatted_discount'] = core()->currency(round($discount, 4));
|
||||
|
||||
$impact->push($report);
|
||||
|
|
@ -77,7 +83,13 @@ class WholeCartToPercent extends Action
|
|||
|
||||
$report['item_id'] = $item->id;
|
||||
$report['product_id'] = $item->child ? $item->child->product_id : $item->product_id;
|
||||
$report['discount'] = $discount;
|
||||
|
||||
if ($discount <= $itemPrice) {
|
||||
$report['discount'] = $discount;
|
||||
} else {
|
||||
$report['discount'] = $itemPrice;
|
||||
}
|
||||
|
||||
$report['formatted_discount'] = core()->currency(round($discount, 4));
|
||||
|
||||
$impact->push($report);
|
||||
|
|
|
|||
Loading…
Reference in New Issue