mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-22 05:06:07 +03:00
fix delivery & hook data
This commit is contained in:
parent
c4230bbadd
commit
8835251d80
@ -205,7 +205,6 @@ class ControllerModuleRetailcrm extends Controller
|
||||
'token=' . $this->session->data['token'], 'SSL'
|
||||
);
|
||||
|
||||
|
||||
$_data['modules'] = array();
|
||||
|
||||
if (isset($this->request->post['retailcrm_module'])) {
|
||||
@ -290,7 +289,7 @@ class ControllerModuleRetailcrm extends Controller
|
||||
$data['order_status'] = $status['retailcrm_status'][$data['order_status_id']];
|
||||
|
||||
$this->load->model('retailcrm/order');
|
||||
$this->model_retailcrm_order->sendToCrm($data, $order['order_id']);
|
||||
$this->model_retailcrm_order->sendToCrm($data, $data['order_id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class ModelRetailcrmOrder extends Model {
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($order_data['order_status_id'])) {
|
||||
if (isset($order_data['order_status_id']) && $order_data['order_status_id'] > 0) {
|
||||
$order['status'] = $settings['retailcrm_status'][$order_data['order_status_id']];
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ class ModelRetailcrmOrder extends Model {
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($order_data['order_status_id'])) {
|
||||
if (isset($order_data['order_status_id']) && $order_data['order_status_id'] > 0) {
|
||||
$order['status'] = $settings['retailcrm_status'][$order_data['order_status_id']];
|
||||
}
|
||||
|
||||
|
@ -29,10 +29,12 @@ class ControllerModuleRetailcrm extends Controller
|
||||
if (!isset($data['fromApi'])) {
|
||||
$this->load->model('setting/setting');
|
||||
$status = $this->model_setting_setting->getSetting('retailcrm');
|
||||
$data['order_status'] = $status['retailcrm_status'][$data['order_status_id']];
|
||||
if ($data['order_status_id'] > 0) {
|
||||
$data['order_status'] = $status['retailcrm_status'][$data['order_status_id']];
|
||||
}
|
||||
|
||||
$this->load->model('retailcrm/order');
|
||||
$this->model_retailcrm_order->sendToCrm($data, $order['order_id']);
|
||||
$this->model_retailcrm_order->sendToCrm($data, $data['order_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,11 +44,14 @@ class ModelRetailcrmOrder extends Model {
|
||||
$order['customerComment'] = $order_data['comment'];
|
||||
|
||||
$deliveryCost = 0;
|
||||
$orderTotals = isset($order_data['totals']) ? $order_data['totals'] : $order_data['order_total'] ;
|
||||
$altTotals = isset($order_data['order_total']) ? $order_data['order_total'] : "";
|
||||
$orderTotals = isset($order_data['totals']) ? $order_data['totals'] : $altTotals ;
|
||||
|
||||
foreach ($orderTotals as $totals) {
|
||||
if ($totals['code'] == 'shipping') {
|
||||
$deliveryCost = $totals['value'];
|
||||
if (!empty($orderTotals)) {
|
||||
foreach ($orderTotals as $totals) {
|
||||
if ($totals['code'] == 'shipping') {
|
||||
$deliveryCost = $totals['value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,7 +89,7 @@ class ModelRetailcrmOrder extends Model {
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($order_data['order_status_id'])) {
|
||||
if (isset($order_data['order_status_id']) && $order_data['order_status_id'] > 0) {
|
||||
$order['status'] = $settings['retailcrm_status'][$order_data['order_status_id']];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user