2015-06-26 18:07:36 +03:00
|
|
|
<?php
|
|
|
|
class ModelRetailcrmOrder extends Model {
|
|
|
|
|
|
|
|
public function send($order, $order_id)
|
|
|
|
{
|
|
|
|
$this->load->model('setting/setting');
|
|
|
|
$settings = $this->model_setting_setting->getSetting('retailcrm');
|
2015-07-23 18:21:04 +03:00
|
|
|
$order['order_status'] = $settings['retailcrm_status'][$order['order_status_id']];
|
2015-07-23 00:27:20 +03:00
|
|
|
|
|
|
|
if(!empty($settings['retailcrm_url']) && !empty($settings['retailcrm_apikey'])) {
|
2015-07-22 23:56:05 +03:00
|
|
|
require_once DIR_SYSTEM . 'library/retailcrm.php';
|
2015-06-26 18:07:36 +03:00
|
|
|
$order['order_id'] = $order_id;
|
|
|
|
$crm = new ApiHelper($settings);
|
|
|
|
$crm->processOrder($order);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|