fix calculate_discount
This commit is contained in:
parent
65fcb2ed46
commit
901af9b767
@ -104,7 +104,7 @@ class WC_Retailcrm_Order_Item extends WC_Retailcrm_Abstracts_Data
|
||||
*/
|
||||
private function calculate_discount(WC_Order_Item_Product $item, $price)
|
||||
{
|
||||
$product_price = $item->get_total() ? $item->get_total() / $item->get_quantity() : 0;
|
||||
$product_price = max(0, round($item->get_total() ? $item->get_total() / $item->get_quantity() : 0));
|
||||
$product_tax = $item->get_total_tax() ? $item->get_total_tax() / $item->get_quantity() : 0;
|
||||
$price_item = $product_price + $product_tax;
|
||||
$discount_price = $price - $price_item;
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit 51a9ab380531935ada9f02daece91356bfe59f09
|
Loading…
x
Reference in New Issue
Block a user