Merge pull request #17 from VitalyArt/master

fix createdAt and email
This commit is contained in:
Alex Lushpai 2016-10-17 15:48:05 +04:00 committed by GitHub
commit e429fb9915
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['firstName'] = $order_data['firstname'];
$order['lastName'] = $order_data['lastname'];
$order['email'] = $order_data['email'];
$order['phone'] = $order_data['telephone'];
$order['customerComment'] = $order_data['comment'];
if(!empty($order_data['email'])) {
$order['email'] = $order_data['email'];
}
$order['customer']['externalId'] = $order_data['customer_id'];
$deliveryCost = 0;

View File

@ -42,10 +42,13 @@ class ModelRetailcrmOrder extends Model {
$order['externalId'] = $order_id;
$order['firstName'] = $order_data['firstname'];
$order['lastName'] = $order_data['lastname'];
$order['email'] = $order_data['email'];
$order['phone'] = $order_data['telephone'];
$order['customerComment'] = $order_data['comment'];
if(!empty($order_data['email'])) {
$order['email'] = $order_data['email'];
}
$deliveryCost = 0;
$altTotals = isset($order_data['order_total']) ? $order_data['order_total'] : "";
$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'];
$order['paymentType'] = $settings['retailcrm_payment'][$payment_code];
@ -165,10 +168,13 @@ class ModelRetailcrmOrder extends Model {
$order['externalId'] = $order_id;
$order['firstName'] = $order_data['firstname'];
$order['lastName'] = $order_data['lastname'];
$order['email'] = $order_data['email'];
$order['phone'] = $order_data['telephone'];
$order['customerComment'] = $order_data['comment'];
if(!empty($order_data['email'])) {
$order['email'] = $order_data['email'];
}
$deliveryCost = 0;
$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];
$country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ;