1
0
mirror of synced 2025-02-21 09:23:14 +03:00

Merge pull request #102 from KMityai/master

fix price in calculate_discount
This commit is contained in:
Alex Lushpai 2019-05-24 11:37:58 +03:00 committed by GitHub
commit a1f23559ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}