mirror of
https://github.com/retailcrm/opencart-module.git
synced 2025-01-22 18:51:42 +03:00
fix for opencart version > 3.0
This commit is contained in:
parent
e69c4c11d9
commit
45fde808b7
@ -5,8 +5,8 @@ class ControllerApiRetailcrm extends Controller
|
||||
{
|
||||
$this->load->model('localisation/country');
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$countries = $this->model_setting_setting->getSetting('retailcrm')['retailcrm_country'];
|
||||
$moduleTitle = $this->getModuleTitle();
|
||||
$countries = $this->model_setting_setting->getSetting($moduleTitle)[$moduleTitle . '_country'];
|
||||
$deliveryTypes = array();
|
||||
|
||||
foreach ($countries as $country) {
|
||||
|
@ -259,16 +259,6 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
'amount' => $amount
|
||||
);
|
||||
|
||||
if (version_compare(VERSION, '3.0', '<')) {
|
||||
if ($order['order_status_id'] == $settingPaid[$order['payment_code'] . '_order_status_id']) {
|
||||
$payment['status'] = 'paid';
|
||||
}
|
||||
} else {
|
||||
if ($order['order_status_id'] == $settingPaid['payment_' . $order['payment_code'] . '_order_status_id']) {
|
||||
$payment['status'] = 'paid';
|
||||
}
|
||||
}
|
||||
|
||||
$payment['order'] = array(
|
||||
'externalId' => $order_id
|
||||
);
|
||||
@ -296,16 +286,6 @@ class ModelExtensionRetailcrmOrder extends Model {
|
||||
'amount' => $amount
|
||||
);
|
||||
|
||||
if (version_compare(VERSION, '3.0', '<')) {
|
||||
if ($order['order_status_id'] == $settingPaid[$order['payment_code'] . '_order_status_id']) {
|
||||
$payment['status'] = 'paid';
|
||||
}
|
||||
} else {
|
||||
if ($order['order_status_id'] == $settingPaid['payment_' . $order['payment_code'] . '_order_status_id']) {
|
||||
$payment['status'] = 'paid';
|
||||
}
|
||||
}
|
||||
|
||||
$this->retailcrm->ordersPaymentEdit($payment);
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,9 @@ class OpencartApiClient {
|
||||
|
||||
public function __construct(Registry &$registry) {
|
||||
$this->registry = $registry;
|
||||
|
||||
$settings = $this->model_setting_setting->getSetting('retailcrm');
|
||||
$this->cookieFileName = $settings['retailcrm_apikey'];
|
||||
$moduleTitle = $this->getModuleTitle();
|
||||
$settings = $this->model_setting_setting->getSetting($moduleTitle);
|
||||
$this->cookieFileName = $settings[$moduleTitle . '_apikey'];
|
||||
|
||||
$this->auth();
|
||||
}
|
||||
@ -331,4 +331,15 @@ class OpencartApiClient {
|
||||
|
||||
return $api_token;
|
||||
}
|
||||
|
||||
private function getModuleTitle()
|
||||
{
|
||||
if (version_compare(VERSION, '3.0', '<')){
|
||||
$title = 'retailcrm';
|
||||
} else {
|
||||
$title = 'module_retailcrm';
|
||||
}
|
||||
|
||||
return $title;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user