Merge pull request #46 from iyzoer/master

Custom folder for catalog model
This commit is contained in:
Akolzin Dmitry 2017-09-01 16:24:05 +02:00 committed by GitHub
commit 55c458dcac
2 changed files with 28 additions and 8 deletions

View File

@ -44,10 +44,15 @@ class ControllerExtensionModuleRetailcrm extends Controller
$data['order_status'] = $status[$moduleTitle . '_status'][$data['order_status_id']]; $data['order_status'] = $status[$moduleTitle . '_status'][$data['order_status_id']];
} }
if (file_exists(DIR_APPLICATION . 'model/extension/retailcrm/custom/order.php')) {
$this->load->model('extension/retailcrm/custom/order');
$this->model_extension_retailcrm_custom_order->sendToCrm($data, $data['order_id']);
} else {
$this->load->model('extension/retailcrm/order'); $this->load->model('extension/retailcrm/order');
$this->model_extension_retailcrm_order->sendToCrm($data, $data['order_id']); $this->model_extension_retailcrm_order->sendToCrm($data, $data['order_id']);
} }
} }
}
/** /**
* Update order on event * Update order on event
@ -85,10 +90,15 @@ class ControllerExtensionModuleRetailcrm extends Controller
$data['order_status'] = $status[$moduleTitle . '_status'][$data['order_status_id']]; $data['order_status'] = $status[$moduleTitle . '_status'][$data['order_status_id']];
} }
if (file_exists(DIR_APPLICATION . 'model/extension/retailcrm/custom/order.php')) {
$this->load->model('extension/retailcrm/custom/order');
$this->model_extension_retailcrm_custom_order->changeInCrm($data, $data['order_id']);
} else {
$this->load->model('extension/retailcrm/order'); $this->load->model('extension/retailcrm/order');
$this->model_extension_retailcrm_order->changeInCrm($data, $data['order_id']); $this->model_extension_retailcrm_order->changeInCrm($data, $data['order_id']);
} }
} }
}
/** /**
* Create customer on event * Create customer on event
@ -119,9 +129,14 @@ class ControllerExtensionModuleRetailcrm extends Controller
); );
} }
if (file_exists(DIR_APPLICATION . 'model/extension/retailcrm/custom/customer.php')) {
$this->load->model('extension/retailcrm/custom/customer');
$this->model_extension_retailcrm_custom_customer->sendToCrm($customer);
} else {
$this->load->model('extension/retailcrm/customer'); $this->load->model('extension/retailcrm/customer');
$this->model_extension_retailcrm_customer->sendToCrm($customer); $this->model_extension_retailcrm_customer->sendToCrm($customer);
} }
}
/** /**
* Update customer on event * Update customer on event
@ -139,9 +154,14 @@ class ControllerExtensionModuleRetailcrm extends Controller
$this->load->model('account/address'); $this->load->model('account/address');
$customer['address'] = $this->model_account_address->getAddress($customer['address_id']); $customer['address'] = $this->model_account_address->getAddress($customer['address_id']);
if (file_exists(DIR_APPLICATION . 'model/extension/retailcrm/custom/customer.php')) {
$this->load->model('extension/retailcrm/custom/customer');
$this->model_extension_retailcrm_custom_customer->changeInCrm($customer);
} else {
$this->load->model('extension/retailcrm/customer'); $this->load->model('extension/retailcrm/customer');
$this->model_extension_retailcrm_customer->changeInCrm($customer); $this->model_extension_retailcrm_customer->changeInCrm($customer);
} }
}
private function getModuleTitle() private function getModuleTitle()
{ {