From d058173aa48b29cd9a2ad816900fb228917e7fd3 Mon Sep 17 00:00:00 2001 From: Day Vladimir Date: Thu, 6 May 2021 13:42:45 +0200 Subject: [PATCH] Changing the connection to bootstrap.php (#229) --- .../model/extension/retailcrm/order.php | 41 ++++++++++--------- .../system/library/retailcrm/retailcrm.php | 2 +- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/upload/catalog/model/extension/retailcrm/order.php b/src/upload/catalog/model/extension/retailcrm/order.php index 93b313a..f69e8ba 100644 --- a/src/upload/catalog/model/extension/retailcrm/order.php +++ b/src/upload/catalog/model/extension/retailcrm/order.php @@ -265,28 +265,29 @@ class ModelExtensionRetailcrmOrder extends Model { if (isset($properties)) $item['properties'] = $properties; $order['items'][] = $item; - - if (isset($order_data['order_status_id']) && $order_data['order_status_id'] > 0) { - $order['status'] = $this->settings[$this->moduleTitle . '_status'][$order_data['order_status_id']]; - } elseif (isset($order_data['order_status_id']) && $order_data['order_status_id'] == 0) { - $order['status'] = $this->settings[$this->moduleTitle . '_missing_status']; - } - - if (isset($this->settings[$this->moduleTitle . '_custom_field']) && $order_data['custom_field']) { - $customFields = $order_data['custom_field']; - - foreach ($customFields as $key => $value) { - if (isset($this->settings[$this->moduleTitle . '_custom_field']['o_' . $key])) { - $customFieldsToCrm[$this->settings[$this->moduleTitle . '_custom_field']['o_' . $key]] = $value; - } - } - - if (isset($customFieldsToCrm)) { - $order['customFields'] = $customFieldsToCrm; - } - } } + + if (isset($order_data['order_status_id']) && $order_data['order_status_id'] > 0) { + $order['status'] = $this->settings[$this->moduleTitle . '_status'][$order_data['order_status_id']]; + } elseif (isset($order_data['order_status_id']) && $order_data['order_status_id'] == 0) { + $order['status'] = $this->settings[$this->moduleTitle . '_missing_status']; + } + + if (isset($this->settings[$this->moduleTitle . '_custom_field']) && $order_data['custom_field']) { + $customFields = $order_data['custom_field']; + + foreach ($customFields as $key => $value) { + if (isset($this->settings[$this->moduleTitle . '_custom_field']['o_' . $key])) { + $customFieldsToCrm[$this->settings[$this->moduleTitle . '_custom_field']['o_' . $key]] = $value; + } + } + + if (isset($customFieldsToCrm)) { + $order['customFields'] = $customFieldsToCrm; + } + } + $payment = array( 'externalId' => $order_id, 'type' => $payment_code, diff --git a/src/upload/system/library/retailcrm/retailcrm.php b/src/upload/system/library/retailcrm/retailcrm.php index 12ce31f..2442809 100644 --- a/src/upload/system/library/retailcrm/retailcrm.php +++ b/src/upload/system/library/retailcrm/retailcrm.php @@ -10,7 +10,7 @@ use retailcrm\factory\OrderConverterFactory; use retailcrm\factory\CustomerConverterFactory; use retailcrm\service\SettingsManager; -require_once 'bootstrap.php'; +require_once DIR_SYSTEM . 'library/retailcrm/bootstrap.php'; class Retailcrm {