fix createdAt and email

This commit is contained in:
VitalyArt 2016-10-14 18:13:16 +03:00
parent b4c386b069
commit 3dc8ae3245
2 changed files with 14 additions and 5 deletions

View File

@ -29,10 +29,13 @@ class ModelRetailcrmOrder extends Model {
$order['externalId'] = $order_data['order_id']; $order['externalId'] = $order_data['order_id'];
$order['firstName'] = $order_data['firstname']; $order['firstName'] = $order_data['firstname'];
$order['lastName'] = $order_data['lastname']; $order['lastName'] = $order_data['lastname'];
$order['email'] = $order_data['email'];
$order['phone'] = $order_data['telephone']; $order['phone'] = $order_data['telephone'];
$order['customerComment'] = $order_data['comment']; $order['customerComment'] = $order_data['comment'];
if(!empty($order_data['email'])) {
$order['email'] = $order_data['email'];
}
$order['customer']['externalId'] = $order_data['customer_id']; $order['customer']['externalId'] = $order_data['customer_id'];
$deliveryCost = 0; $deliveryCost = 0;

View File

@ -42,10 +42,13 @@ class ModelRetailcrmOrder extends Model {
$order['externalId'] = $order_id; $order['externalId'] = $order_id;
$order['firstName'] = $order_data['firstname']; $order['firstName'] = $order_data['firstname'];
$order['lastName'] = $order_data['lastname']; $order['lastName'] = $order_data['lastname'];
$order['email'] = $order_data['email'];
$order['phone'] = $order_data['telephone']; $order['phone'] = $order_data['telephone'];
$order['customerComment'] = $order_data['comment']; $order['customerComment'] = $order_data['comment'];
if(!empty($order_data['email'])) {
$order['email'] = $order_data['email'];
}
$deliveryCost = 0; $deliveryCost = 0;
$altTotals = isset($order_data['order_total']) ? $order_data['order_total'] : ""; $altTotals = isset($order_data['order_total']) ? $order_data['order_total'] : "";
$orderTotals = isset($order_data['totals']) ? $order_data['totals'] : $altTotals ; $orderTotals = isset($order_data['totals']) ? $order_data['totals'] : $altTotals ;
@ -58,7 +61,7 @@ class ModelRetailcrmOrder extends Model {
} }
} }
$order['createdAt'] = date('Y-m-d H:i:s'); $order['createdAt'] = $order_data['date_added'];
$payment_code = $order_data['payment_code']; $payment_code = $order_data['payment_code'];
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
@ -165,10 +168,13 @@ class ModelRetailcrmOrder extends Model {
$order['externalId'] = $order_id; $order['externalId'] = $order_id;
$order['firstName'] = $order_data['firstname']; $order['firstName'] = $order_data['firstname'];
$order['lastName'] = $order_data['lastname']; $order['lastName'] = $order_data['lastname'];
$order['email'] = $order_data['email'];
$order['phone'] = $order_data['telephone']; $order['phone'] = $order_data['telephone'];
$order['customerComment'] = $order_data['comment']; $order['customerComment'] = $order_data['comment'];
if(!empty($order_data['email'])) {
$order['email'] = $order_data['email'];
}
$deliveryCost = 0; $deliveryCost = 0;
$orderTotals = isset($order_data['totals']) ? $order_data['totals'] : $order_data['order_total'] ; $orderTotals = isset($order_data['totals']) ? $order_data['totals'] : $order_data['order_total'] ;
@ -178,7 +184,7 @@ class ModelRetailcrmOrder extends Model {
} }
} }
$order['createdAt'] = date('Y-m-d H:i:s'); $order['createdAt'] = $order_data['date_added'];
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code]; $order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
$country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ; $country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ;