From 361b806265a1ad24f77b0727ad64095e11f2aebf Mon Sep 17 00:00:00 2001 From: "Anton.AE" Date: Mon, 7 Jul 2025 18:40:48 +0300 Subject: [PATCH] Andrei | fix bitrix CRM functions in ae site --- .../cosmopet/modules/forms/module-ajax-controller.php | 8 +++++--- .../themes/cosmopet/modules/forms/module-controller.php | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php b/wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php index bfed83b..2eca41f 100644 --- a/wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php +++ b/wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php @@ -354,9 +354,11 @@ function notify_order_paid($order_id) { $handler = FormHandlerFactory::getHandler(['tg']); $handler->handle($formData, []); - - $b24Handler = new b24Handler(); - $b24Handler->b24_update_deal_stage_by_order_id($order_id); + global $site_env; + if ($site_env->site_revion == 'ru'){ + $b24Handler = new b24Handler(); + $b24Handler->b24_update_deal_stage_by_order_id($order_id); + } } ?> \ No newline at end of file diff --git a/wp-content/themes/cosmopet/modules/forms/module-controller.php b/wp-content/themes/cosmopet/modules/forms/module-controller.php index cefee07..091f530 100644 --- a/wp-content/themes/cosmopet/modules/forms/module-controller.php +++ b/wp-content/themes/cosmopet/modules/forms/module-controller.php @@ -554,9 +554,10 @@ class FormHandlerFactory { } } - +global $site_env; +if ($site_env->site_revion == 'ru'){ // обработка обновления профиля пользователя -add_action('profile_update', 'handle_profile_update', 10, 2); + add_action('profile_update', 'handle_profile_update', 10, 2); function handle_profile_update($userID, $old_user_data) { $user = get_user_by('ID', $userID); @@ -579,7 +580,7 @@ add_action('profile_update', 'handle_profile_update', 10, 2); error_log('Ошибка обновления контакта в Bitrix24: ' . $result['error']); } } - +} function get_utm_data() { $utm_data = [];