From eb507ea62d28d7e49e90c03ab6624e9b1881be7f Mon Sep 17 00:00:00 2001 From: Pavel Date: Wed, 3 Jul 2019 16:35:54 +0300 Subject: [PATCH] Don't update 'createdAt' while updating order in retailCRM --- .gitignore | 1 + admin/model/retailcrm/order.php | 4 +--- catalog/model/retailcrm/order.php | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/admin/model/retailcrm/order.php b/admin/model/retailcrm/order.php index 628584c..c22c42f 100644 --- a/admin/model/retailcrm/order.php +++ b/admin/model/retailcrm/order.php @@ -52,7 +52,7 @@ class ModelRetailcrmOrder extends Model { } } - $order['createdAt'] = date('Y-m-d H:i:s'); + $order['createdAt'] = isset($order_data['date_added']) ? $order_data['date_added'] : date('Y-m-d H:i:s'); $payment_code = $order_data['payment_code']; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; @@ -154,9 +154,7 @@ class ModelRetailcrmOrder extends Model { } } - $order['createdAt'] = date('Y-m-d H:i:s'); $order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; - $country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ; $order['delivery'] = array( diff --git a/catalog/model/retailcrm/order.php b/catalog/model/retailcrm/order.php index d37acae..0eaae5d 100644 --- a/catalog/model/retailcrm/order.php +++ b/catalog/model/retailcrm/order.php @@ -56,7 +56,7 @@ class ModelRetailcrmOrder extends Model { } } - $order['createdAt'] = date('Y-m-d H:i:s'); + $order['createdAt'] = isset($order_data['date_added']) ? $order_data['date_added'] : date('Y-m-d H:i:s'); $payment_code = $order_data['payment_code']; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; @@ -162,9 +162,7 @@ class ModelRetailcrmOrder extends Model { } } - $order['createdAt'] = date('Y-m-d H:i:s'); $order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; - $country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ; $order['delivery'] = array(