2014-08-19 07:56:17 +04:00
|
|
|
Installation
|
|
|
|
============
|
|
|
|
|
|
|
|
### Clone module.
|
|
|
|
```
|
|
|
|
git clone git@github.com:/intarocrm/opencart-module.git
|
|
|
|
```
|
|
|
|
|
|
|
|
### Install Rest API Client.
|
|
|
|
|
|
|
|
```
|
|
|
|
cd opencart-module/system/library/intarocrm
|
|
|
|
./composer.phar install
|
|
|
|
```
|
|
|
|
|
|
|
|
### Install module
|
|
|
|
```
|
|
|
|
cp -r opencart-module/* /path/to/opecart/instance
|
|
|
|
```
|
|
|
|
|
|
|
|
### Activate via Admin interface.
|
|
|
|
|
|
|
|
Go to Modules -> Intstall module. Before running exchange you must configure module.
|
|
|
|
|
|
|
|
### Export
|
|
|
|
|
|
|
|
Setup cron job for periodically catalog export
|
|
|
|
|
|
|
|
```
|
2014-08-20 00:19:54 +04:00
|
|
|
* */12 * * * /usr/bin/php /path/to/opencart/cli/cli_export.php >> /path/to/opencart/system/logs/cronjob_export.log 2>&1
|
2014-08-19 07:56:17 +04:00
|
|
|
```
|
|
|
|
|
2014-08-21 15:04:46 +04:00
|
|
|
Into your CRM settings set path to exported file
|
|
|
|
|
|
|
|
```
|
2014-08-21 15:05:33 +04:00
|
|
|
/download/intarocrm.xml
|
2014-08-21 15:04:46 +04:00
|
|
|
```
|
|
|
|
|
2014-08-19 07:56:17 +04:00
|
|
|
### Exchange setup
|
|
|
|
|
|
|
|
|
|
|
|
#### Export new order from shop to CRM
|
|
|
|
|
|
|
|
```
|
2014-08-28 02:13:37 +04:00
|
|
|
$this->load->model('intarocrm/order');
|
2014-08-29 12:24:04 +04:00
|
|
|
$this->model_intarocrm_order->send($data, $order_id);
|
2014-08-19 07:56:17 +04:00
|
|
|
```
|
|
|
|
|
2014-08-28 18:39:02 +04:00
|
|
|
Add this lines into:
|
2014-08-29 12:24:04 +04:00
|
|
|
* /catalog/model/checkout/order.php script, into addOrder method before return statement
|
2014-08-29 17:04:21 +04:00
|
|
|
|
|
|
|
```
|
2014-08-29 18:03:26 +04:00
|
|
|
if (!isset($data['fromApi'])) {
|
|
|
|
$this->load->model('setting/setting');
|
|
|
|
$status = $this->model_setting_setting->getSetting('intarocrm');
|
|
|
|
$data['order_status'] = $status['intarocrm_status'][$data['order_status_id']];
|
|
|
|
|
|
|
|
$this->load->model('intarocrm/order');
|
|
|
|
$this->model_intarocrm_order->send($data, $order_id);
|
|
|
|
}
|
2014-08-29 17:04:21 +04:00
|
|
|
```
|
|
|
|
|
|
|
|
Add this lines into:
|
2014-08-28 18:39:02 +04:00
|
|
|
* /admin/model/sale/order.php script, into addOrder & editOrder methods at the end of these methods
|
2014-08-19 07:56:17 +04:00
|
|
|
|
|
|
|
#### Export new order from CRM to shop
|
|
|
|
|
|
|
|
Setup cron job for exchange between CRM & your shop
|
|
|
|
|
|
|
|
```
|
2014-08-20 00:19:54 +04:00
|
|
|
*/5 * * * * /usr/bin/php /path/to/opencart/cli/cli_export.php >> /path/to/opencart/system/logs/cronjob_history.log 2>&1
|
2014-08-19 08:03:30 +04:00
|
|
|
```
|