Send order to RetailCRM when it created
1.5.x
2.3.x
retailcrm.ru
load->model('retailcrm/order');
$this->model_retailcrm_order->sendToCrm($data, $order_id);
]]>
db->query("UPDATE `" . DB_PREFIX . "order` SET total = '" . (float)$total . "', affiliate_id = '" . (int)$affiliate_id . "', commission = '" . (float)$commission . "' WHERE order_id = '" . (int)$order_id . "'");]]>
load->model('setting/setting');
$status = $this->model_setting_setting->getSetting('retailcrm');
if (!empty($data['order_status_id'])) {
$data['order_status'] = $status['retailcrm_status'][$data['order_status_id']];
}
$this->load->model('retailcrm/order');
if (isset ($order_query)) {
$this->model_retailcrm_order->changeInCrm($data, $order_id);
} else {
$this->model_retailcrm_order->sendToCrm($data, $order_id);
}
}
]]>