mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-25 14:46:06 +03:00
some fixes for opencart 2.2
This commit is contained in:
parent
3b184b14e7
commit
185d28f2b6
@ -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
|
||||
|
@ -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 установите путь к файлу выгрузки
|
||||
|
0
admin/controller/module/retailcrm.php
Executable file → Normal file
0
admin/controller/module/retailcrm.php
Executable file → Normal file
0
admin/model/retailcrm/history.php
Executable file → Normal file
0
admin/model/retailcrm/history.php
Executable file → Normal file
12
admin/model/retailcrm/icml.php
Executable file → Normal file
12
admin/model/retailcrm/icml.php
Executable file → Normal file
@ -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'),
|
||||
|
0
catalog/controller/module/retailcrm.php
Executable file → Normal file
0
catalog/controller/module/retailcrm.php
Executable file → Normal file
0
catalog/model/retailcrm/order.php
Executable file → Normal file
0
catalog/model/retailcrm/order.php
Executable file → Normal file
43
system/cron/dispatch.php
Executable file → Normal file
43
system/cron/dispatch.php
Executable file → Normal file
@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
$_SERVER['HTTPS'] = 'off';
|
||||
$_SERVER['SERVER_PORT'] = 80;
|
||||
|
||||
// Ensure $cli_action is set
|
||||
if (!isset($cli_action)) {
|
||||
echo 'ERROR: $cli_action must be set in calling script.';
|
||||
@ -31,10 +34,17 @@ if (!defined('DIR_APPLICATION')) {
|
||||
require_once(DIR_SYSTEM . 'startup.php');
|
||||
|
||||
// Application Classes
|
||||
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');
|
||||
if (version_compare(VERSION, '2.2', '>=')) {
|
||||
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,6 +68,9 @@ foreach ($query->rows as $setting) {
|
||||
if (!$setting['serialized']) {
|
||||
$config->set($setting['key'], $setting['value']);
|
||||
} else {
|
||||
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);
|
||||
|
0
system/library/retailcrm/OpencartApiClient.php
Executable file → Normal file
0
system/library/retailcrm/OpencartApiClient.php
Executable file → Normal file
Loading…
Reference in New Issue
Block a user