mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-29 00:26:06 +03:00
bugfixes
This commit is contained in:
parent
7cceb9852c
commit
a4261d544c
@ -18,9 +18,6 @@ class ModelRetailcrmOrder extends Model {
|
|||||||
|
|
||||||
$order = array();
|
$order = array();
|
||||||
|
|
||||||
$payment_code = $order_data['payment_code'];
|
|
||||||
$delivery_code = $order_data['shipping_code'];
|
|
||||||
|
|
||||||
$customers = $this->retailcrm->customersList(
|
$customers = $this->retailcrm->customersList(
|
||||||
array(
|
array(
|
||||||
'name' => $order_data['telephone'],
|
'name' => $order_data['telephone'],
|
||||||
@ -44,30 +41,34 @@ class ModelRetailcrmOrder extends Model {
|
|||||||
$order['customerComment'] = $order_data['comment'];
|
$order['customerComment'] = $order_data['comment'];
|
||||||
|
|
||||||
$deliveryCost = 0;
|
$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 ;
|
||||||
|
|
||||||
|
if (!empty($orderTotals)) {
|
||||||
foreach ($orderTotals as $totals) {
|
foreach ($orderTotals as $totals) {
|
||||||
if ($totals['code'] == 'shipping') {
|
if ($totals['code'] == 'shipping') {
|
||||||
$deliveryCost = $totals['value'];
|
$deliveryCost = $totals['value'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$order['createdAt'] = date('Y-m-d H:i:s');
|
$order['createdAt'] = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$payment_code = $order_data['payment_code'];
|
||||||
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
|
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
|
||||||
|
|
||||||
$country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ;
|
$delivery_code = $order_data['shipping_code'];
|
||||||
|
|
||||||
$order['delivery'] = array(
|
$order['delivery'] = array(
|
||||||
'code' => $settings['retailcrm_delivery'][$delivery_code],
|
'code' => $settings['retailcrm_delivery'][$delivery_code],
|
||||||
'cost' => $deliveryCost,
|
'cost' => $deliveryCost,
|
||||||
'address' => array(
|
'address' => array(
|
||||||
'index' => $order_data['shipping_postcode'],
|
'index' => $order_data['shipping_postcode'],
|
||||||
'city' => $order_data['shipping_city'],
|
'city' => $order_data['shipping_city'],
|
||||||
'country' => $order_data['shipping_country_id'],
|
'countryIso' => $order_data['shipping_iso_code_2'],
|
||||||
'region' => $order_data['shipping_zone_id'],
|
'region' => $order_data['shipping_zone'],
|
||||||
'text' => implode(', ', array(
|
'text' => implode(', ', array(
|
||||||
$order_data['shipping_postcode'],
|
$order_data['shipping_postcode'],
|
||||||
$country,
|
(isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '',
|
||||||
$order_data['shipping_city'],
|
$order_data['shipping_city'],
|
||||||
$order_data['shipping_address_1'],
|
$order_data['shipping_address_1'],
|
||||||
$order_data['shipping_address_2']
|
$order_data['shipping_address_2']
|
||||||
|
@ -18,9 +18,6 @@ class ModelRetailcrmOrder extends Model {
|
|||||||
|
|
||||||
$order = array();
|
$order = array();
|
||||||
|
|
||||||
$payment_code = $order_data['payment_code'];
|
|
||||||
$delivery_code = $order_data['shipping_code'];
|
|
||||||
|
|
||||||
$customers = $this->retailcrm->customersList(
|
$customers = $this->retailcrm->customersList(
|
||||||
array(
|
array(
|
||||||
'name' => $order_data['telephone'],
|
'name' => $order_data['telephone'],
|
||||||
@ -56,21 +53,22 @@ class ModelRetailcrmOrder extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$order['createdAt'] = date('Y-m-d H:i:s');
|
$order['createdAt'] = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$payment_code = $order_data['payment_code'];
|
||||||
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
|
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
|
||||||
|
|
||||||
$country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ;
|
$delivery_code = $order_data['shipping_code'];
|
||||||
|
|
||||||
$order['delivery'] = array(
|
$order['delivery'] = array(
|
||||||
'code' => $settings['retailcrm_delivery'][$delivery_code],
|
'code' => $settings['retailcrm_delivery'][$delivery_code],
|
||||||
'cost' => $deliveryCost,
|
'cost' => $deliveryCost,
|
||||||
'address' => array(
|
'address' => array(
|
||||||
'index' => $order_data['shipping_postcode'],
|
'index' => $order_data['shipping_postcode'],
|
||||||
'city' => $order_data['shipping_city'],
|
'city' => $order_data['shipping_city'],
|
||||||
'country' => $order_data['shipping_country_id'],
|
'countryIso' => $order_data['shipping_iso_code_2'],
|
||||||
'region' => $order_data['shipping_zone_id'],
|
'region' => $order_data['shipping_zone'],
|
||||||
'text' => implode(', ', array(
|
'text' => implode(', ', array(
|
||||||
$order_data['shipping_postcode'],
|
$order_data['shipping_postcode'],
|
||||||
$country,
|
(isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '',
|
||||||
$order_data['shipping_city'],
|
$order_data['shipping_city'],
|
||||||
$order_data['shipping_address_1'],
|
$order_data['shipping_address_1'],
|
||||||
$order_data['shipping_address_2']
|
$order_data['shipping_address_2']
|
||||||
|
Loading…
Reference in New Issue
Block a user