opencart-module/admin/model/retailcrm/order.php

23 lines
669 B
PHP
Raw Normal View History

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');
$settings['domain'] = parse_url(HTTP_SERVER, PHP_URL_HOST);
if(
!empty($settings['retailcrm_url'])
&&
!empty($settings['retailcrm_apikey'])
) {
require_once DIR_SYSTEM . 'library/retailcrm/Retailcrm.php';
$order['order_id'] = $order_id;
$crm = new ApiHelper($settings);
$crm->processOrder($order);
}
}
}