1
0
mirror of synced 2025-01-18 17:01:41 +03:00

fix send empty order number

This commit is contained in:
Sergey 2019-04-12 12:46:04 +03:00
parent 65ee374c94
commit d8bbbc2d8a

View File

@ -97,11 +97,18 @@ class WC_Retailcrm_Order extends WC_Retailcrm_Abstracts_Data
*/
protected function set_number($order)
{
if ($this->is_new) {
$this->set_data_field('number', $order->get_order_number());
}
if (isset($this->settings['update_number'])
&& $this->settings['update_number'] == WC_Retailcrm_Base::YES
&& !$this->is_new
) {
$this->set_data_field('number', $order->get_order_number());
if (!$this->is_new) {
$this->set_data_field('number', $order->get_order_number());
}
} elseif (!$this->is_new) {
unset($this->data['number']);
}
}