From 5fcdb944eb54dcbd0d1b36a33463ac44a671dfc9 Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Tue, 4 Feb 2025 11:17:24 +0300 Subject: [PATCH] Correction on functionality --- src/include/api/class-wc-retailcrm-request.php | 4 ++-- src/include/functions.php | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/include/api/class-wc-retailcrm-request.php b/src/include/api/class-wc-retailcrm-request.php index 316654b..ecd331b 100644 --- a/src/include/api/class-wc-retailcrm-request.php +++ b/src/include/api/class-wc-retailcrm-request.php @@ -78,9 +78,9 @@ class WC_Retailcrm_Request 'woo_version' => WC()->version ?? '', 'php_version' => function_exists('phpversion') ? phpversion() : '', 'module_version' => WC_Integration_Retailcrm::MODULE_VERSION, - 'ga_option_active' => getOption('ua') === WC_Retailcrm_Abstracts_Settings::YES, + 'ga_option_is_active' => getOptionByCode('ua') === WC_Retailcrm_Abstracts_Settings::YES, ]) - : $parameters = array_merge($this->defaultParameters, $parameters); + : array_merge($this->defaultParameters, $parameters); $url = $this->url . $path; diff --git a/src/include/functions.php b/src/include/functions.php index b980ef2..b9dd1d9 100644 --- a/src/include/functions.php +++ b/src/include/functions.php @@ -208,9 +208,7 @@ function isCorporateOrder($wcCustomer, $wcOrder) return !empty($wcCustomer->get_billing_company()) || !empty($wcOrder->get_billing_company()); } -function getOption($optionName) +function getOptionByCode($optionName) { - $options = get_option(WC_Retailcrm_Base::$option_key); - - return $options[$optionName] ?? null; + return get_option(WC_Retailcrm_Base::$option_key)[$optionName] ?? null; }