Merge pull request #116 from iyzoer/v2.2

Добавлена передача внешнего кода клиента при создании заказа
This commit is contained in:
Alex Lushpai 2018-09-28 17:50:52 +03:00 committed by GitHub
commit 6ba09d3ac5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 15 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.env
bin/
vendor/
www/

View File

@ -22,6 +22,9 @@ class ModelRetailcrmOrder extends Model {
$order = array(); $order = array();
if ($order_data['customer_id']) {
$order['customer']['externalId'] = $order_data['customer_id'];
} else {
$customers = $this->retailcrm->customersList( $customers = $this->retailcrm->customersList(
array( array(
'name' => $order_data['telephone'], 'name' => $order_data['telephone'],
@ -38,6 +41,7 @@ class ModelRetailcrmOrder extends Model {
} }
unset($customers); unset($customers);
}
$order['externalId'] = $order_id; $order['externalId'] = $order_id;
$order['firstName'] = $order_data['firstname']; $order['firstName'] = $order_data['firstname'];