1
0
Fork 0
mirror of synced 2025-04-06 07:13:33 +03:00

fixed two mistakes

This commit is contained in:
Pavel 2019-11-22 14:23:49 +03:00 committed by Павел
parent 02364c6edc
commit 8496262170

View file

@ -75,7 +75,7 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
}
if (!$customers_corporate_since_id && isset($this->retailcrm_settings['history_customers_corporate'])) {
$this->startDateCustomers = new DateTime($this->retailcrm_settings['history_orders']);
$this->startDateCustomersCorporate = new DateTime($this->retailcrm_settings['history_orders']);
}
$this->customersHistory($this->startDateCustomers->format('Y-m-d H:i:s'), $customers_since_id);
@ -790,12 +790,10 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
}
}
if (isset($order['delivery']['cost']) || isset($order['delivery']['netCost'])) {
if (!wc_tax_enabled()) {
$shipping->set_total($order['delivery']['cost']);
} else {
$shipping->set_total($order['delivery']['netCost']);
}
if (isset($order['delivery']['cost']) && !wc_tax_enabled()) {
$shipping->set_total($order['delivery']['cost']);
} elseif (isset($order['delivery']['netCost'])) {
$shipping->set_total($order['delivery']['netCost']);
}
$shipping->set_order_id($wc_order->get_id());