1
0
mirror of synced 2025-01-30 23:01:43 +03:00

fix price in calculate_discount

This commit is contained in:
Круглов Дмитрий 2019-05-16 12:05:56 +03:00
parent c51fb0fd8a
commit 37d8eb660b

View File

@ -107,7 +107,7 @@ class WC_Retailcrm_Order_Item extends WC_Retailcrm_Abstracts_Data
$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;
$discount_price = max(0, round($price)) - $price_item;
return $discount_price;
}