From c5f691b8bfe9bb713b2c9c63731bed4032e62fa0 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 3 Sep 2014 13:16:30 +0400 Subject: [PATCH] fix customer externalID --- system/library/intarocrm/apihelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/library/intarocrm/apihelper.php b/system/library/intarocrm/apihelper.php index 005f45e..fc37502 100644 --- a/system/library/intarocrm/apihelper.php +++ b/system/library/intarocrm/apihelper.php @@ -47,7 +47,7 @@ class ApiHelper if(count($customers) > 0 && isset($customers[0]['externalId'])) { $order['customerId'] = $customers[0]['externalId']; } else { - $order['customerId'] = ($data['customer_id'] != '') ? $data['customer_id'] : 0; + $order['customerId'] = ($data['customer_id'] != '') ? $data['customer_id'] : (microtime(true) * 10000) . mt_rand(1, 1000); $customer['externalId'] = $order['customerId']; $customer['firstName'] = $data['firstname']; $customer['lastName'] = $data['lastname'];