diff --git a/README.md b/README.md index 941b5e8..78b7f5d 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Add to cron: Add to cron: ``` -* */4 * * * /usr/bin/php /path/to/opencart/system/cron/export.php >> /path/to/opencart/system/logs/cronjob_export.log 2>&1 +* */4 * * * /usr/bin/php /path/to/opencart/system/cron/icml.php >> /path/to/opencart/system/logs/cronjob_icml.log 2>&1 ``` Your export file will be available by following url diff --git a/README.ru.md b/README.ru.md index b13b2fd..44a8723 100644 --- a/README.ru.md +++ b/README.ru.md @@ -89,7 +89,7 @@ if (!isset($data['fromApi'])) { Для периодической выгрузки каталога добавьте в cron следующую запись: ``` -* */4 * * * /usr/bin/php /path/to/opencart/system/cron/export.php >> /path/to/opencart/system/logs/cronjob_export.log 2>&1 +* */4 * * * /usr/bin/php /path/to/opencart/system/cron/icml.php >> /path/to/opencart/system/logs/cronjob_icml.log 2>&1 ``` В настройках CRM установите путь к файлу выгрузки diff --git a/admin/controller/module/retailcrm.php b/admin/controller/module/retailcrm.php old mode 100755 new mode 100644 diff --git a/admin/model/retailcrm/history.php b/admin/model/retailcrm/history.php old mode 100755 new mode 100644 diff --git a/admin/model/retailcrm/icml.php b/admin/model/retailcrm/icml.php old mode 100755 new mode 100644 index f60d378..39ac931 --- a/admin/model/retailcrm/icml.php +++ b/admin/model/retailcrm/icml.php @@ -208,6 +208,18 @@ class ModelRetailcrmIcml extends Model { $this->load->model('tool/image'); + if (version_compare(VERSION, '2.2', '>=')) { + $currentTheme = $this->config->get('config_theme'); + $width = $this->config->get($currentTheme . '_image_related_width') ? $this->config->get($currentTheme . '_image_related_width') : 200; + $height = $this->config->get($currentTheme . '_image_related_height') ? $this->config->get($currentTheme . '_image_related_height') : 200; + + return $this->model_tool_image->resize( + $image, + $width, + $height + ); + } + return $this->model_tool_image->resize( $image, $this->config->get('config_image_product_width'), diff --git a/catalog/controller/module/retailcrm.php b/catalog/controller/module/retailcrm.php old mode 100755 new mode 100644 diff --git a/catalog/model/retailcrm/order.php b/catalog/model/retailcrm/order.php old mode 100755 new mode 100644 diff --git a/system/cron/dispatch.php b/system/cron/dispatch.php old mode 100755 new mode 100644 index 4869ec5..56fba4f --- a/system/cron/dispatch.php +++ b/system/cron/dispatch.php @@ -1,5 +1,8 @@ =')) { + require_once(DIR_SYSTEM . 'library/cart/currency.php'); + require_once(DIR_SYSTEM . 'library/cart/user.php'); + require_once(DIR_SYSTEM . 'library/cart/weight.php'); + require_once(DIR_SYSTEM . 'library/cart/length.php'); +} else { + require_once(DIR_SYSTEM . 'library/currency.php'); + require_once(DIR_SYSTEM . 'library/user.php'); + require_once(DIR_SYSTEM . 'library/weight.php'); + require_once(DIR_SYSTEM . 'library/length.php'); +} // Registry $registry = new Registry(); @@ -58,7 +68,10 @@ foreach ($query->rows as $setting) { if (!$setting['serialized']) { $config->set($setting['key'], $setting['value']); } else { - $config->set($setting['key'], unserialize($setting['value'])); + if (version_compare(VERSION, '2.2', '>=')) + $config->set($setting['key'], json_decode($setting['value']), true); + else + $config->set($setting['key'], unserialize($setting['value'])); } } @@ -70,6 +83,13 @@ $registry->set('url', $url); $log = new Log($config->get('config_error_filename')); $registry->set('log', $log); + +// Event +if (version_compare(VERSION, '2.2', '>=')) { + $event = new Event($registry); + $registry->set('event', $event); +} + function error_handler($errno, $errstr, $errfile, $errline) { global $log, $config; @@ -133,10 +153,17 @@ $registry->set('language', $language); $document = new Document(); $registry->set('document', $document); -$registry->set('currency', new Currency($registry)); -$registry->set('weight', new Weight($registry)); -$registry->set('length', new Length($registry)); -$registry->set('user', new User($registry)); +if (version_compare(VERSION, '2.2', '>=')) { + $registry->set('currency', new Cart\Currency($registry)); + $registry->set('weight', new Cart\Weight($registry)); + $registry->set('length', new Cart\Length($registry)); + $registry->set('user', new Cart\User($registry)); +} else { + $registry->set('currency', new Currency($registry)); + $registry->set('weight', new Weight($registry)); + $registry->set('length', new Length($registry)); + $registry->set('user', new User($registry)); +} $controller = new Front($registry); $action = new Action($cli_action); diff --git a/system/cron/export.php b/system/cron/icml.php similarity index 100% rename from system/cron/export.php rename to system/cron/icml.php diff --git a/system/library/retailcrm/OpencartApiClient.php b/system/library/retailcrm/OpencartApiClient.php old mode 100755 new mode 100644