From 0cfad0849ff3ae7d2fad2a7002ece433cdb44c67 Mon Sep 17 00:00:00 2001 From: Pavel Date: Tue, 26 Nov 2019 10:32:01 +0300 Subject: [PATCH] fix for customers upload --- src/include/class-wc-retailcrm-customers.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/include/class-wc-retailcrm-customers.php b/src/include/class-wc-retailcrm-customers.php index 554373e..134ac25 100644 --- a/src/include/class-wc-retailcrm-customers.php +++ b/src/include/class-wc-retailcrm-customers.php @@ -167,13 +167,7 @@ if (!class_exists('WC_Retailcrm_Customers')) : $customer = $this->wcCustomerGet($user->ID); if ($corporateEnabled && static::customerPossiblyCorporate($customer)) { - $this->processCorporateCustomer($customer); - $data_corporate[] = array( - 'customer' => $this->customerCorporate, - 'address' => $this->customerCorporateAddress, - 'company' => $this->customerCorporateCompany, - 'contact' => $this->customerCorporateContact - ); + $data_corporate[] = $customer; } else { $this->processCustomer($customer); $data_customers[] = $this->customer; @@ -189,6 +183,11 @@ if (!class_exists('WC_Retailcrm_Customers')) : time_nanosleep(0, 250000000); } + foreach ($data_corporate as $corporateCustomer) { + $this->createCorporateCustomer($corporateCustomer); + time_nanosleep(0, 50000000); + } + return $data; }