From 40d54c6b62e8e66b8bb76dca29ab43109d77edf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Tue, 7 Jul 2020 12:56:05 +0300 Subject: [PATCH] fix for customer phone from history --- .../woocommerce/class-wc-retailcrm-wc-customer-builder.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/include/customer/woocommerce/class-wc-retailcrm-wc-customer-builder.php b/src/include/customer/woocommerce/class-wc-retailcrm-wc-customer-builder.php index afbd792..7eddc4e 100644 --- a/src/include/customer/woocommerce/class-wc-retailcrm-wc-customer-builder.php +++ b/src/include/customer/woocommerce/class-wc-retailcrm-wc-customer-builder.php @@ -151,12 +151,14 @@ class WC_Retailcrm_WC_Customer_Builder extends WC_Retailcrm_Abstract_Builder $this->customer->set_billing_email($this->dataValue('email', $this->customer->get_billing_email())); $phones = $this->dataValue('phones', array()); - if (count($phones) > 0) { + if ((is_array($phones) || $phones instanceof Countable) && count($phones) > 0) { $phoneData = reset($phones); if (is_array($phoneData) && isset($phoneData['number'])) { $this->customer->set_billing_phone($phoneData['number']); } + } elseif (is_string($phones) || is_numeric($phones)) { + $this->customer->set_billing_phone($phones); } $address = $this->dataValue('address');