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

Add transfer of the client's comment to the WC order

This commit is contained in:
Dima Uryvskiy 2021-08-25 16:00:07 +03:00 committed by GitHub
parent 22eaceb6f5
commit a92253c0a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,14 +343,14 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
$wcOrder->update_status($options[$order['status']]); $wcOrder->update_status($options[$order['status']]);
} }
if (isset($order['customerComment'])) {
$wcOrder->set_customer_note($order['customerComment']);
}
if (isset($order['managerComment']) && !empty($order['managerComment'])) { if (isset($order['managerComment']) && !empty($order['managerComment'])) {
$wcOrder->add_order_note($order['managerComment'], 0, false); $wcOrder->add_order_note($order['managerComment'], 0, false);
} }
if (isset($order['customerComment']) && !empty($order['customerComment'])) {
$wcOrder->set_customer_note($order['customerComment']);
}
if (isset($order['firstName'])) { if (isset($order['firstName'])) {
$wcOrder->set_shipping_first_name($order['firstName']); $wcOrder->set_shipping_first_name($order['firstName']);
} }
@ -663,6 +663,10 @@ if ( ! class_exists( 'WC_Retailcrm_History' ) ) :
$wcOrder->add_order_note($order['managerComment'], 0, false); $wcOrder->add_order_note($order['managerComment'], 0, false);
} }
if (isset($order['customerComment']) && !empty($order['customerComment'])) {
$wcOrder->set_customer_note($order['customerComment']);
}
// TODO Check if that works; also don't forget to set this company field while creating order from CMS! // TODO Check if that works; also don't forget to set this company field while creating order from CMS!
if ($this->retailcrm->getCorporateEnabled() if ($this->retailcrm->getCorporateEnabled()
&& self::isOrderCorporate($order) && self::isOrderCorporate($order)