From efb8be92b94becb2c88b96df01795a9114372d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Thu, 30 Apr 2020 10:29:33 +0300 Subject: [PATCH] restore correct merge state --- src/include/class-wc-retailcrm-base.php | 15 +++------------ src/include/class-wc-retailcrm-orders.php | 15 +++++++++++++++ tests/bin/install.sh | 0 3 files changed, 18 insertions(+), 12 deletions(-) mode change 100755 => 100644 tests/bin/install.sh diff --git a/src/include/class-wc-retailcrm-base.php b/src/include/class-wc-retailcrm-base.php index f78f6d5..494e36a 100644 --- a/src/include/class-wc-retailcrm-base.php +++ b/src/include/class-wc-retailcrm-base.php @@ -264,16 +264,6 @@ if (!class_exists('WC_Retailcrm_Base')) { update_option(static::$option_key, $options); } -<<<<<<< HEAD - /** - * Create customer in retailCRM - * - * @param int $customer_id - * - * @return void - * @throws \Exception - */ -======= /** * Create customer in retailCRM * @@ -282,13 +272,13 @@ if (!class_exists('WC_Retailcrm_Base')) { * @return void * @throws \Exception */ ->>>>>>> merge changes public function create_customer($customer_id) { if (WC_Retailcrm_Plugin::history_running() === true) { return; } +<<<<<<< HEAD <<<<<<< HEAD $client = $this->getApiClient(); @@ -303,6 +293,8 @@ if (!class_exists('WC_Retailcrm_Base')) { return; } ======= +======= +>>>>>>> restore correct merge state $client = $this->getApiClient(); if (empty($client)) { @@ -315,7 +307,6 @@ if (!class_exists('WC_Retailcrm_Base')) { if ($resp && $resp->isSuccessful() && isset($resp['customers']) && count($resp['customers']) > 0) { return; } ->>>>>>> merge changes $this->customers->createCustomer($customer_id); } diff --git a/src/include/class-wc-retailcrm-orders.php b/src/include/class-wc-retailcrm-orders.php index fef16d2..9d038d7 100644 --- a/src/include/class-wc-retailcrm-orders.php +++ b/src/include/class-wc-retailcrm-orders.php @@ -131,6 +131,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) : if ($wpUser instanceof WP_User) { <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD <<<<<<< HEAD @@ -210,10 +211,13 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) : } ======= ======= +======= +>>>>>>> restore correct merge state if (!WC_Retailcrm_Customers::isCustomer($wpUser)) { return $wcOrder; } +<<<<<<< HEAD >>>>>>> corporate customers alternative logic >>>>>>> corporate customers alternative logic $wpUserId = (int) $wpUser->get('ID'); @@ -226,6 +230,10 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) : $this->fillOrderCreate($wpUserId, $wpUser->get('billing_email'), $wcOrder); >>>>>>> merge changes >>>>>>> merge changes +======= + $wpUserId = (int) $wpUser->get('ID'); + $this->fillOrderCreate($wpUserId, $wpUser->get('billing_email'), $wcOrder); +>>>>>>> restore correct merge state } else { $wcCustomer = $this->customers->buildCustomerFromOrderData($wcOrder); $this->fillOrderCreate(0, $wcCustomer->get_billing_email(), $wcOrder); @@ -295,6 +303,7 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) : $this->order['customer']['id'] = $corporateId; } else { <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD <<<<<<< HEAD @@ -324,15 +333,21 @@ if ( ! class_exists( 'WC_Retailcrm_Orders' ) ) : >>>>>>> WIP: corporate customers support ======= ======= +======= +>>>>>>> restore correct merge state $this->customers->fillCorporateAddress( $crmCorporate['id'], new WC_Customer($wcCustomerId), $wcOrder ); +<<<<<<< HEAD >>>>>>> new address logic & fixes >>>>>>> new address logic & fixes $this->order['customer']['id'] = $crmCorporate['id']; +======= + $this->order['customer']['id'] = $crmCorporate['id']; +>>>>>>> restore correct merge state } $this->order['contact']['id'] = $foundCustomerId; diff --git a/tests/bin/install.sh b/tests/bin/install.sh old mode 100755 new mode 100644