From 293ae37ea3210ec04edb4137d085299d332a84b0 Mon Sep 17 00:00:00 2001 From: "Anton.AE" Date: Sun, 5 Jul 2026 16:32:08 +0300 Subject: [PATCH] fix --- .../assets/css/test1-shared-shell.css | 75 ++++++++++++++ .../themes/twentytwentyfour/functions.php | 98 ++++++++++++++++++- .../themes/twentytwentyfour/page-contacts.php | 4 +- .../twentytwentyfour/page-privacy-policy.php | 49 ++++++++++ .../themes/twentytwentyfour/page-test1.php | 5 +- .../privacy-policy-content.txt | 0 .../template-parts/test1-shared-footer.php | 36 +++---- .../themes/water-delivery/functions.php | 93 ------------------ .../themes/water-delivery/inc/hook/custom.php | 2 +- .../themes/water-delivery/privacy-policy.php | 44 --------- wp-content/themes/water-delivery/style.css | 81 --------------- 11 files changed, 246 insertions(+), 241 deletions(-) create mode 100644 wp-content/themes/twentytwentyfour/page-privacy-policy.php rename wp-content/themes/{water-delivery => twentytwentyfour}/privacy-policy-content.txt (100%) delete mode 100644 wp-content/themes/water-delivery/privacy-policy.php diff --git a/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css b/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css index 749f27af..28ba0efc 100644 --- a/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css +++ b/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css @@ -2,6 +2,81 @@ font-family: "Manrope", sans-serif; } +.test1-shared-privacy-page .privacy-policy-section { + padding-top: 72px; +} + +.test1-shared-privacy-page .privacy-policy-content { + max-width: 980px; + margin: 0 auto; +} + +.test1-shared-privacy-page .privacy-policy-content p { + margin: 0 0 18px; + color: #1f2937; + line-height: 1.7; +} + +.personal-data-consent { + display: flex; + align-items: flex-start; + gap: 10px; + margin: 2px 0 14px; + color: #374151; + font-size: 13px; + line-height: 1.45; +} + +.personal-data-consent input { + flex: 0 0 auto; + width: auto; + margin-top: 3px; +} + +.cookie-consent-banner { + position: fixed; + right: 24px; + bottom: 24px; + z-index: 9999; + display: flex; + align-items: center; + gap: 18px; + max-width: 760px; + padding: 18px 20px; + background: #fff; + border: 1px solid rgba(15, 23, 42, 0.14); + box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2); +} + +.cookie-consent-banner[hidden] { + display: none; +} + +.cookie-consent-banner p { + margin: 0; + color: #1f2937; + line-height: 1.45; +} + +.cookie-consent-accept { + flex: 0 0 auto; + padding: 10px 20px; + border: 0; + background: #0f766e; + color: #fff; + font-weight: 700; +} + +@media (max-width: 767px) { + .cookie-consent-banner { + right: 12px; + bottom: 12px; + left: 12px; + flex-direction: column; + align-items: stretch; + } +} + .test1-shared-shell .container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; diff --git a/wp-content/themes/twentytwentyfour/functions.php b/wp-content/themes/twentytwentyfour/functions.php index 18922841..688e9e13 100644 --- a/wp-content/themes/twentytwentyfour/functions.php +++ b/wp-content/themes/twentytwentyfour/functions.php @@ -452,7 +452,7 @@ add_filter( 'template_include', 'twentytwentyfour_single_post_template', 25 ); * @return void */ function twentytwentyfour_test1_assets() { - $use_test1_assets = is_front_page() || is_home() || is_singular( 'post' ) || is_page( array( 'test1', 'faq', 'contacts', 'delivery', 'service' ) ); + $use_test1_assets = is_front_page() || is_home() || is_singular( 'post' ) || is_page( array( 'test1', 'faq', 'contacts', 'delivery', 'service' ) ) || twentytwentyfour_is_privacy_policy_request(); if ( ! $use_test1_assets ) { return; @@ -648,6 +648,10 @@ function twentytwentyfour_submit_lead_ajax() { $form_type = isset( $_POST['form_type'] ) ? sanitize_key( wp_unslash( $_POST['form_type'] ) ) : 'contacts_page'; $page_url = isset( $_POST['page_url'] ) ? esc_url_raw( wp_unslash( $_POST['page_url'] ) ) : ''; + if ( empty( $_POST['privacy_consent'] ) ) { + wp_send_json_error( array( 'message' => __( 'Необходимо согласиться на обработку персональных данных.', 'twentytwentyfour' ) ), 422 ); + } + if ( 'contacts' === $form_type ) { $form_type = false !== strpos( $page_url, '/contacts' ) ? 'contacts_page' : 'landing_contacts'; } @@ -728,6 +732,96 @@ function twentytwentyfour_submit_lead_ajax() { add_action( 'wp_ajax_twentytwentyfour_submit_lead', 'twentytwentyfour_submit_lead_ajax' ); add_action( 'wp_ajax_nopriv_twentytwentyfour_submit_lead', 'twentytwentyfour_submit_lead_ajax' ); +function twentytwentyfour_is_privacy_policy_request() { + if ( is_admin() || empty( $_SERVER['REQUEST_URI'] ) ) { + return false; + } + + $request_path = trim( wp_parse_url( wp_unslash( $_SERVER['REQUEST_URI'] ), PHP_URL_PATH ), '/' ); + + return 'privacy-policy' === $request_path; +} + +function twentytwentyfour_privacy_policy_url() { + return home_url( '/privacy-policy/' ); +} + +function twentytwentyfour_privacy_policy_template() { + if ( twentytwentyfour_is_privacy_policy_request() ) { + status_header( 200 ); + include get_theme_file_path( 'page-privacy-policy.php' ); + exit; + } +} +add_action( 'template_redirect', 'twentytwentyfour_privacy_policy_template', 0 ); + +function twentytwentyfour_privacy_consent_checkbox() { + ?> + + + + + " aria-label="" required> +
@@ -78,3 +79,4 @@ get_header( 'test1', $test1_header_args ); 'test1-shared-shell test1-shared-privacy-page', + 'header_action_url' => function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' ), + 'header_action_label' => __( 'Корзина', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?> + +
+
+
+
+

+ + ' . nl2br( esc_html( $paragraph ) ) . '

'; + } + } + ?> +
+
+
+
+ + +
Спасибо! Заявка принята. Мы свяжемся с вами для подтверждения заказа.
@@ -744,6 +745,7 @@ get_header( 'test1' ); +
Спасибо! Ваш заказ сохранен. Мы свяжемся с вами в ближайшее время.
@@ -751,3 +753,4 @@ get_header( 'test1' ); diff --git a/wp-content/themes/water-delivery/privacy-policy.php b/wp-content/themes/water-delivery/privacy-policy.php deleted file mode 100644 index 9506361d..00000000 --- a/wp-content/themes/water-delivery/privacy-policy.php +++ /dev/null @@ -1,44 +0,0 @@ - - -
-
-
-
-

-
- -
- ' . nl2br( esc_html( $paragraph ) ) . '

'; - } - } - ?> -
-
-
-
- -