diff --git a/wp-content/themes/cosmopet/global-functions/multisite-functions.php b/wp-content/themes/cosmopet/global-functions/multisite-functions.php
index 0e8472c..6b6d4a1 100644
--- a/wp-content/themes/cosmopet/global-functions/multisite-functions.php
+++ b/wp-content/themes/cosmopet/global-functions/multisite-functions.php
@@ -82,30 +82,6 @@ function custom_canonical_url() {
}
}
-add_action('wp_head', 'add_facebook_pixel');
-function add_facebook_pixel() {
- ?>
-
-
-
-
-
-
- get_status() !== 'processing' && $order->get_status() !== 'completed')) return;
-
- $items = [];
- foreach ($order->get_items() as $item) {
- $product = $item->get_product();
- $items[] = [
- 'item_id' => $product->get_id(),
- 'item_name' => $product->get_name(),
- 'price' => $product->get_price(),
- 'quantity' => $item->get_quantity()
- ];
+
+
-
- get_status() !== 'processing' && $order->get_status() !== 'completed')) return;
+
+ $items = [];
+ foreach ($order->get_items() as $item) {
+ $product = $item->get_product();
+ $items[] = [
+ 'item_id' => $product->get_id(),
+ 'item_name' => $product->get_name(),
+ 'price' => $product->get_price(),
+ 'quantity' => $item->get_quantity()
+ ];
+ }
+ ?>
+
+ ',
- 'value':
- }
+ // 3. Событие AddPaymentInfo
+ if (is_checkout() && !is_wc_endpoint_url('order-received')) {
+ $currency = get_woocommerce_currency();
+ $cart_total = WC()->cart ? WC()->cart->get_total('edit') : 0;
+ ?>
+
-
+ prefix . 'cosmopet_likes';
-$user_id = get_current_user_id();
-$result = $wpdb->get_var($wpdb->prepare(
- "SELECT COUNT(*) FROM $table_name WHERE post_id = %d AND user_id = %d",
- $post_id, $user_id
-));
-return $result > 0;
+ if (!is_user_logged_in()) {
+ return false;
+ }
+ global $wpdb;
+ $table_name = $wpdb->prefix . 'cosmopet_likes';
+ $user_id = get_current_user_id();
+ $result = $wpdb->get_var($wpdb->prepare(
+ "SELECT COUNT(*) FROM $table_name WHERE post_id = %d AND user_id = %d",
+ $post_id, $user_id
+ ));
+ return $result > 0;
}
function is_user_liked_comment($comment_id) {
-if (!is_user_logged_in()) {
- return false;
-}
-global $wpdb;
-$table_name = $wpdb->prefix . 'cosmopet_likes';
-$user_id = get_current_user_id();
-$result = $wpdb->get_var($wpdb->prepare(
- "SELECT COUNT(*) FROM $table_name WHERE comment_id = %d AND user_id = %d",
- $comment_id, $user_id
-));
-return $result > 0;
+ if (!is_user_logged_in()) {
+ return false;
+ }
+ global $wpdb;
+ $table_name = $wpdb->prefix . 'cosmopet_likes';
+ $user_id = get_current_user_id();
+ $result = $wpdb->get_var($wpdb->prepare(
+ "SELECT COUNT(*) FROM $table_name WHERE comment_id = %d AND user_id = %d",
+ $comment_id, $user_id
+ ));
+ return $result > 0;
}
diff --git a/wp-content/themes/cosmopet/temp-functions/filters-logic.php b/wp-content/themes/cosmopet/temp-functions/filters-logic.php
index 87c7b20..4abab5f 100644
--- a/wp-content/themes/cosmopet/temp-functions/filters-logic.php
+++ b/wp-content/themes/cosmopet/temp-functions/filters-logic.php
@@ -9,14 +9,14 @@ register_sidebar( array(
'after_title' => '',
) );
-// Для кнопки "Применить фильтр"
-add_filter('wbw_filter_submit_button_text', 'change_wbw_filter_button_text');
-function change_wbw_filter_button_text($text) {
- return 'Ваш текст'; // Например, "Фильтровать" или "Поиск"
-}
+// // Для кнопки "Применить фильтр"
+// add_filter('wbw_filter_submit_button_text', 'change_wbw_filter_button_text');
+// function change_wbw_filter_button_text($text) {
+// return 'Ваш текст'; // Например, "Фильтровать" или "Поиск"
+// }
-// Для кнопки сброса (если есть)
-add_filter('wbw_filter_reset_button_text', 'change_wbw_reset_button_text');
-function change_wbw_reset_button_text($text) {
- return 'Сбросить';
-}
\ No newline at end of file
+// // Для кнопки сброса (если есть)
+// add_filter('wbw_filter_reset_button_text', 'change_wbw_reset_button_text');
+// function change_wbw_reset_button_text($text) {
+// return 'Сбросить';
+// }
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/templates/layout.twig b/wp-content/themes/cosmopet/templates/layout.twig
index 24a3a07..2d83f3b 100644
--- a/wp-content/themes/cosmopet/templates/layout.twig
+++ b/wp-content/themes/cosmopet/templates/layout.twig
@@ -7,7 +7,9 @@
- {{ header_scripts }}
+ {% if site_mode == 'production' %}
+ {{ header_scripts }}
+ {% endif %}