mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-24 06:06:06 +03:00
parent
707e818aac
commit
3a28b7c94d
@ -137,7 +137,7 @@ class ControllerModuleRetailcrm extends Controller
|
||||
$this->retailcrm = new RetailcrmProxy(
|
||||
$url,
|
||||
$key,
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->setLogs()
|
||||
);
|
||||
|
||||
$_data['delivery'] = $this->model_retailcrm_references
|
||||
@ -338,4 +338,15 @@ class ControllerModuleRetailcrm extends Controller
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function setLogs()
|
||||
{
|
||||
if (version_compare(VERSION, '2.0', '>')) {
|
||||
$logs = DIR_SYSTEM . 'storage/logs/ecomlogic.log';
|
||||
} else {
|
||||
$logs = DIR_SYSTEM . 'logs/ecomlogic.log';
|
||||
}
|
||||
|
||||
return $logs;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class ModelRetailcrmCustomer extends Model {
|
||||
$this->retailcrmApi = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->serLogs()
|
||||
);
|
||||
|
||||
$customersToCrm = array();
|
||||
@ -48,4 +48,15 @@ class ModelRetailcrmCustomer extends Model {
|
||||
|
||||
return $customerToCrm;
|
||||
}
|
||||
|
||||
private function setLogs()
|
||||
{
|
||||
if (version_compare(VERSION, '2.0', '>')) {
|
||||
$logs = DIR_SYSTEM . 'storage/logs/ecomlogic.log';
|
||||
} else {
|
||||
$logs = DIR_SYSTEM . 'logs/ecomlogic.log';
|
||||
}
|
||||
|
||||
return $logs;
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class ModelRetailcrmHistory extends Model
|
||||
$crm = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->serLogs()
|
||||
);
|
||||
|
||||
$lastRun = !empty($history['retailcrm_history'])
|
||||
@ -467,4 +467,15 @@ class ModelRetailcrmHistory extends Model
|
||||
|
||||
return array('customers' => $customersIdsFix, 'orders' => $ordersIdsFix);
|
||||
}
|
||||
|
||||
private function setLogs()
|
||||
{
|
||||
if (version_compare(VERSION, '2.0', '>')) {
|
||||
$logs = DIR_SYSTEM . 'storage/logs/ecomlogic.log';
|
||||
} else {
|
||||
$logs = DIR_SYSTEM . 'logs/ecomlogic.log';
|
||||
}
|
||||
|
||||
return $logs;
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,19 @@ class ModelRetailcrmOrder extends Model {
|
||||
$this->load->model('setting/setting');
|
||||
$this->settings = $this->model_setting_setting->getSetting('retailcrm');
|
||||
|
||||
if(empty($orders))
|
||||
return false;
|
||||
if(empty($settings['retailcrm_url']) || empty($settings['retailcrm_apikey']))
|
||||
return false;
|
||||
|
||||
require_once DIR_SYSTEM . 'library/retailcrm/bootstrap.php';
|
||||
|
||||
$this->retailcrmApi = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
$this->serLogs()
|
||||
);
|
||||
|
||||
$ordersToCrm = array();
|
||||
|
||||
foreach($orders as $order) {
|
||||
@ -113,4 +126,15 @@ class ModelRetailcrmOrder extends Model {
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
||||
private function setLogs()
|
||||
{
|
||||
if (version_compare(VERSION, '2.0', '>')) {
|
||||
$logs = DIR_SYSTEM . 'storage/logs/ecomlogic.log';
|
||||
} else {
|
||||
$logs = DIR_SYSTEM . 'logs/ecomlogic.log';
|
||||
}
|
||||
|
||||
return $logs;
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ class ModelRetailcrmReferences extends Model
|
||||
$this->retailcrm = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->setLogs()
|
||||
);
|
||||
|
||||
$response = $this->retailcrm->deliveryTypesList();
|
||||
@ -109,7 +109,7 @@ class ModelRetailcrmReferences extends Model
|
||||
$this->retailcrm = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->serLogs()
|
||||
);
|
||||
|
||||
$response = $this->retailcrm->statusesList();
|
||||
@ -127,7 +127,7 @@ class ModelRetailcrmReferences extends Model
|
||||
$this->retailcrm = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->setLogs()
|
||||
);
|
||||
|
||||
$response = $this->retailcrm->paymentTypesList();
|
||||
@ -135,4 +135,15 @@ class ModelRetailcrmReferences extends Model
|
||||
return ($response === false) ? array() : $response->paymentTypes;
|
||||
}
|
||||
}
|
||||
|
||||
private function setLogs()
|
||||
{
|
||||
if (version_compare(VERSION, '2.0', '>')) {
|
||||
$logs = DIR_SYSTEM . 'storage/logs/ecomlogic.log';
|
||||
} else {
|
||||
$logs = DIR_SYSTEM . 'logs/ecomlogic.log';
|
||||
}
|
||||
|
||||
return $logs;
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class ModelRetailcrmCustomer extends Model {
|
||||
$this->retailcrmApi = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->setLogs()
|
||||
);
|
||||
|
||||
$customerToCrm = $this->process($customer);
|
||||
@ -39,4 +39,15 @@ class ModelRetailcrmCustomer extends Model {
|
||||
|
||||
return $customerToCrm;
|
||||
}
|
||||
|
||||
private function setLogs()
|
||||
{
|
||||
if (version_compare(VERSION, '2.0', '>')) {
|
||||
$logs = DIR_SYSTEM . 'storage/logs/ecomlogic.log';
|
||||
} else {
|
||||
$logs = DIR_SYSTEM . 'logs/ecomlogic.log';
|
||||
}
|
||||
|
||||
return $logs;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ class ModelRetailcrmOrder extends Model {
|
||||
$this->retailcrm = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->setLogs()
|
||||
);
|
||||
|
||||
$order = array();
|
||||
@ -157,7 +157,7 @@ class ModelRetailcrmOrder extends Model {
|
||||
$this->retailcrm = new RetailcrmProxy(
|
||||
$settings['retailcrm_url'],
|
||||
$settings['retailcrm_apikey'],
|
||||
DIR_SYSTEM . 'logs/retailcrm.log'
|
||||
$this->setLogs()
|
||||
);
|
||||
|
||||
$order = array();
|
||||
@ -257,4 +257,15 @@ class ModelRetailcrmOrder extends Model {
|
||||
$this->retailcrm->ordersEdit($order);
|
||||
}
|
||||
}
|
||||
|
||||
private function setLogs()
|
||||
{
|
||||
if (version_compare(VERSION, '2.0', '>')) {
|
||||
$logs = DIR_SYSTEM . 'storage/logs/ecomlogic.log';
|
||||
} else {
|
||||
$logs = DIR_SYSTEM . 'logs/ecomlogic.log';
|
||||
}
|
||||
|
||||
return $logs;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user