fix
This commit is contained in:
@@ -2,6 +2,81 @@
|
|||||||
font-family: "Manrope", sans-serif;
|
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 {
|
.test1-shared-shell .container {
|
||||||
width: min(1180px, calc(100% - 32px));
|
width: min(1180px, calc(100% - 32px));
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|||||||
@@ -452,7 +452,7 @@ add_filter( 'template_include', 'twentytwentyfour_single_post_template', 25 );
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function twentytwentyfour_test1_assets() {
|
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 ) {
|
if ( ! $use_test1_assets ) {
|
||||||
return;
|
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';
|
$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'] ) ) : '';
|
$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 ) {
|
if ( 'contacts' === $form_type ) {
|
||||||
$form_type = false !== strpos( $page_url, '/contacts' ) ? 'contacts_page' : 'landing_contacts';
|
$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_twentytwentyfour_submit_lead', 'twentytwentyfour_submit_lead_ajax' );
|
||||||
add_action( 'wp_ajax_nopriv_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() {
|
||||||
|
?>
|
||||||
|
<label class="personal-data-consent">
|
||||||
|
<input type="checkbox" name="privacy_consent" value="1" required>
|
||||||
|
<span><?php echo wp_kses_post( sprintf( __( 'Согласен(на) на обработку персональных данных и принимаю <a href="%s">Политику конфиденциальности</a>', 'twentytwentyfour' ), esc_url( twentytwentyfour_privacy_policy_url() ) ) ); ?></span>
|
||||||
|
</label>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
function twentytwentyfour_cookie_consent_banner() {
|
||||||
|
?>
|
||||||
|
<div class="cookie-consent-banner" data-cookie-consent-banner hidden>
|
||||||
|
<p>
|
||||||
|
<?php esc_html_e( 'Мы используем файлы cookie для улучшения работы сайта. Продолжая использовать сайт, Вы соглашаетесь с нашей', 'twentytwentyfour' ); ?>
|
||||||
|
<a href="<?php echo esc_url( twentytwentyfour_privacy_policy_url() ); ?>"><?php esc_html_e( 'Политикой конфиденциальности', 'twentytwentyfour' ); ?></a>.
|
||||||
|
</p>
|
||||||
|
<button type="button" class="cookie-consent-accept" data-cookie-consent-accept><?php esc_html_e( 'Принять', 'twentytwentyfour' ); ?></button>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var consentName = 'water_delivery_cookie_consent';
|
||||||
|
var banner = document.querySelector('[data-cookie-consent-banner]');
|
||||||
|
var acceptButton = document.querySelector('[data-cookie-consent-accept]');
|
||||||
|
var privacyUrl = <?php echo wp_json_encode( twentytwentyfour_privacy_policy_url() ); ?>;
|
||||||
|
var consentHtml = 'Согласен(на) на обработку персональных данных и принимаю <a href="' + privacyUrl + '">Политику конфиденциальности</a>';
|
||||||
|
var hasConsent = document.cookie.split('; ').some(function (cookie) {
|
||||||
|
return cookie === consentName + '=accepted';
|
||||||
|
});
|
||||||
|
|
||||||
|
if (banner && !hasConsent) {
|
||||||
|
banner.hidden = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (acceptButton) {
|
||||||
|
acceptButton.addEventListener('click', function () {
|
||||||
|
document.cookie = consentName + '=accepted; max-age=31536000; path=/; SameSite=Lax';
|
||||||
|
if (banner) {
|
||||||
|
banner.hidden = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
document.querySelectorAll('form').forEach(function (form) {
|
||||||
|
var ignored = form.matches('.search-form, .woocommerce-cart-form, form[role="search"]');
|
||||||
|
var hasPersonalFields = form.querySelector('input[type="email"], input[type="tel"], input[name*="phone"], input[name*="email"], textarea, .wpforms-submit, .wpcf7-submit');
|
||||||
|
|
||||||
|
if (ignored || !hasPersonalFields || form.querySelector('.personal-data-consent')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var field = document.createElement('label');
|
||||||
|
field.className = 'personal-data-consent';
|
||||||
|
field.innerHTML = '<input type="checkbox" name="privacy_consent" value="1" required> <span>' + consentHtml + '</span>';
|
||||||
|
|
||||||
|
var submit = form.querySelector('button[type="submit"], input[type="submit"], .wpforms-submit, .wpcf7-submit');
|
||||||
|
if (submit && submit.parentNode) {
|
||||||
|
submit.parentNode.insertBefore(field, submit);
|
||||||
|
} else {
|
||||||
|
form.appendChild(field);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
add_action( 'wp_footer', 'twentytwentyfour_cookie_consent_banner', 20 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send WooCommerce checkout orders to Telegram.
|
* Send WooCommerce checkout orders to Telegram.
|
||||||
*
|
*
|
||||||
@@ -785,7 +879,7 @@ add_action( 'woocommerce_checkout_order_processed', 'twentytwentyfour_send_check
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function twentytwentyfour_test1_shared_shell_assets() {
|
function twentytwentyfour_test1_shared_shell_assets() {
|
||||||
if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || ( function_exists( 'is_shop' ) && is_shop() ) || is_home() || is_singular( 'post' ) || is_page( 'faq' ) || is_page( 'contacts' ) || is_page( 'delivery' ) || is_page( 'service' ) ) ) {
|
if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || ( function_exists( 'is_shop' ) && is_shop() ) || is_home() || is_singular( 'post' ) || is_page( 'faq' ) || is_page( 'contacts' ) || is_page( 'delivery' ) || is_page( 'service' ) || twentytwentyfour_is_privacy_policy_request() ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Contacts template with shared test1 header/footer.
|
* Contacts template with shared test1 header/footer.
|
||||||
*
|
*
|
||||||
@@ -41,6 +41,7 @@ get_header( 'test1', $test1_header_args );
|
|||||||
<input class="field" type="tel" name="phone" placeholder="<?php esc_attr_e( 'Телефон', 'twentytwentyfour' ); ?>" aria-label="<?php esc_attr_e( 'Телефон', 'twentytwentyfour' ); ?>" required>
|
<input class="field" type="tel" name="phone" placeholder="<?php esc_attr_e( 'Телефон', 'twentytwentyfour' ); ?>" aria-label="<?php esc_attr_e( 'Телефон', 'twentytwentyfour' ); ?>" required>
|
||||||
<input class="field" type="text" name="address" placeholder="<?php esc_attr_e( 'Адрес доставки в Севастополе', 'twentytwentyfour' ); ?>" aria-label="<?php esc_attr_e( 'Адрес доставки', 'twentytwentyfour' ); ?>" required>
|
<input class="field" type="text" name="address" placeholder="<?php esc_attr_e( 'Адрес доставки в Севастополе', 'twentytwentyfour' ); ?>" aria-label="<?php esc_attr_e( 'Адрес доставки', 'twentytwentyfour' ); ?>" required>
|
||||||
<textarea class="field" name="comment" placeholder="<?php esc_attr_e( 'Что нужно доставить: например, 2 бутыли 19 л и 1 упаковка 1.5 л', 'twentytwentyfour' ); ?>" aria-label="<?php esc_attr_e( 'Комментарий к заказу', 'twentytwentyfour' ); ?>"></textarea>
|
<textarea class="field" name="comment" placeholder="<?php esc_attr_e( 'Что нужно доставить: например, 2 бутыли 19 л и 1 упаковка 1.5 л', 'twentytwentyfour' ); ?>" aria-label="<?php esc_attr_e( 'Комментарий к заказу', 'twentytwentyfour' ); ?>"></textarea>
|
||||||
|
<?php twentytwentyfour_privacy_consent_checkbox(); ?>
|
||||||
<button class="button" type="submit"><?php esc_html_e( 'Отправить заявку', 'twentytwentyfour' ); ?></button>
|
<button class="button" type="submit"><?php esc_html_e( 'Отправить заявку', 'twentytwentyfour' ); ?></button>
|
||||||
<div class="success-note" id="contactSuccess" role="status" aria-live="polite"><?php esc_html_e( 'Спасибо! Заявка принята. Мы свяжемся с вами для подтверждения заказа.', 'twentytwentyfour' ); ?></div>
|
<div class="success-note" id="contactSuccess" role="status" aria-live="polite"><?php esc_html_e( 'Спасибо! Заявка принята. Мы свяжемся с вами для подтверждения заказа.', 'twentytwentyfour' ); ?></div>
|
||||||
</form>
|
</form>
|
||||||
@@ -78,3 +79,4 @@ get_header( 'test1', $test1_header_args );
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
get_footer( 'test1' );
|
get_footer( 'test1' );
|
||||||
|
|
||||||
|
|||||||
49
wp-content/themes/twentytwentyfour/page-privacy-policy.php
Normal file
49
wp-content/themes/twentytwentyfour/page-privacy-policy.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Privacy policy page template.
|
||||||
|
*
|
||||||
|
* @package Twenty_Twenty_Four
|
||||||
|
*/
|
||||||
|
|
||||||
|
$test1_header_args = array(
|
||||||
|
'body_class' => '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 );
|
||||||
|
?>
|
||||||
|
|
||||||
|
<main class="site-main" role="main">
|
||||||
|
<section class="section privacy-policy-section">
|
||||||
|
<div class="container">
|
||||||
|
<article class="privacy-policy-content">
|
||||||
|
<h1 class="section-title"><?php esc_html_e( 'Политика конфиденциальности', 'twentytwentyfour' ); ?></h1>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$policy_file = get_theme_file_path( 'privacy-policy-content.txt' );
|
||||||
|
$policy_text = file_exists( $policy_file ) ? file_get_contents( $policy_file ) : '';
|
||||||
|
|
||||||
|
if ( '' !== trim( $policy_text ) ) {
|
||||||
|
$policy_text = str_replace( array( "\r\n", "\r" ), "\n", $policy_text );
|
||||||
|
$paragraphs = preg_split( "/\n{2,}/", trim( $policy_text ) );
|
||||||
|
|
||||||
|
foreach ( $paragraphs as $paragraph ) {
|
||||||
|
$paragraph = trim( $paragraph );
|
||||||
|
|
||||||
|
if ( '' === $paragraph ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<p>' . nl2br( esc_html( $paragraph ) ) . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer( 'test1' );
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Standalone landing template for the page slug "test1".
|
* Standalone landing template for the page slug "test1".
|
||||||
*
|
*
|
||||||
@@ -658,6 +658,7 @@ get_header( 'test1' );
|
|||||||
<input class="field" type="tel" name="phone" placeholder="Телефон" aria-label="Телефон" required>
|
<input class="field" type="tel" name="phone" placeholder="Телефон" aria-label="Телефон" required>
|
||||||
<input class="field" type="text" name="address" placeholder="Адрес доставки в Севастополе" aria-label="Адрес доставки" required>
|
<input class="field" type="text" name="address" placeholder="Адрес доставки в Севастополе" aria-label="Адрес доставки" required>
|
||||||
<textarea class="field" name="comment" placeholder="Что нужно доставить: например, 2 бутыли 19 л и 1 упаковка 1.5 л" aria-label="Комментарий к заказу"></textarea>
|
<textarea class="field" name="comment" placeholder="Что нужно доставить: например, 2 бутыли 19 л и 1 упаковка 1.5 л" aria-label="Комментарий к заказу"></textarea>
|
||||||
|
<?php twentytwentyfour_privacy_consent_checkbox(); ?>
|
||||||
<button class="button" type="submit">Отправить заявку</button>
|
<button class="button" type="submit">Отправить заявку</button>
|
||||||
<div class="success-note" id="contactSuccess" role="status" aria-live="polite">Спасибо! Заявка принята. Мы свяжемся с вами для подтверждения заказа.</div>
|
<div class="success-note" id="contactSuccess" role="status" aria-live="polite">Спасибо! Заявка принята. Мы свяжемся с вами для подтверждения заказа.</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -744,6 +745,7 @@ get_header( 'test1' );
|
|||||||
<option value="Для офиса">Для офиса</option>
|
<option value="Для офиса">Для офиса</option>
|
||||||
</select>
|
</select>
|
||||||
<textarea class="field" name="customerOrder" id="orderItemsField" placeholder="Комментарий к заказу" aria-label="Комментарий к заказу"></textarea>
|
<textarea class="field" name="customerOrder" id="orderItemsField" placeholder="Комментарий к заказу" aria-label="Комментарий к заказу"></textarea>
|
||||||
|
<?php twentytwentyfour_privacy_consent_checkbox(); ?>
|
||||||
<button class="button" type="submit">Подтвердить заказ</button>
|
<button class="button" type="submit">Подтвердить заказ</button>
|
||||||
<div class="success-note" id="orderSuccess" role="status" aria-live="polite">Спасибо! Ваш заказ сохранен. Мы свяжемся с вами в ближайшее время.</div>
|
<div class="success-note" id="orderSuccess" role="status" aria-live="polite">Спасибо! Ваш заказ сохранен. Мы свяжемся с вами в ближайшее время.</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -751,3 +753,4 @@ get_header( 'test1' );
|
|||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
get_footer( 'test1' );
|
get_footer( 'test1' );
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Shared footer for test1-related WooCommerce pages.
|
* Shared footer for test1-related WooCommerce pages.
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,7 @@ if ( ! $blog_url ) {
|
|||||||
<div class="container classic-footer-shell">
|
<div class="container classic-footer-shell">
|
||||||
<div class="classic-footer-main">
|
<div class="classic-footer-main">
|
||||||
<div class="classic-footer-col brand-col">
|
<div class="classic-footer-col brand-col">
|
||||||
<a class="brand" href="<?php echo esc_url( home_url( '/' ) ); ?>" aria-label="Перейти на главную страницу">
|
<a class="brand" href="<?php echo esc_url( home_url( '/' ) ); ?>" aria-label="Перейти на главную страницу">
|
||||||
<span class="brand-mark" aria-hidden="true">
|
<span class="brand-mark" aria-hidden="true">
|
||||||
<!-- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<!-- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M12 2C9 6.1 6 9.4 6 13.2C6 16.9 8.69 20 12 20C15.31 20 18 16.9 18 13.2C18 9.4 15 6.1 12 2Z" fill="currentColor"/>
|
<path d="M12 2C9 6.1 6 9.4 6 13.2C6 16.9 8.69 20 12 20C15.31 20 18 16.9 18 13.2C18 9.4 15 6.1 12 2Z" fill="currentColor"/>
|
||||||
@@ -25,38 +25,38 @@ if ( ! $blog_url ) {
|
|||||||
<img src="<?php echo esc_url( home_url( '/wp-content/themes/twentytwentyfour/assets/images/logo.webp' ) ); ?>" alt="">
|
<img src="<?php echo esc_url( home_url( '/wp-content/themes/twentytwentyfour/assets/images/logo.webp' ) ); ?>" alt="">
|
||||||
</span>
|
</span>
|
||||||
<span class="brand-text">
|
<span class="brand-text">
|
||||||
<strong>АкваЛиния</strong>
|
<strong>АкваЛиния</strong>
|
||||||
<span>вода с доставкой для Севастополя</span>
|
<span>вода с доставкой для Севастополя</span>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<p class="footer-description">Доставка воды в Севастополе для дома, офиса, кафе и фитнес-клубов. Вода 19 литров, питьевая и минеральная вода с удобным заказом на сайте.</p>
|
<p class="footer-description">Доставка воды в Севастополе для дома, офиса, кафе и фитнес-клубов. Вода 19 литров, питьевая и минеральная вода с удобным заказом на сайте.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="classic-footer-col">
|
<div class="classic-footer-col">
|
||||||
<h3>Навигация</h3>
|
<h3>Навигация</h3>
|
||||||
<div class="footer-links">
|
<div class="footer-links">
|
||||||
<a href="<?php echo esc_url( home_url( '/#catalog' ) ); ?>">Каталог</a>
|
<a href="<?php echo esc_url( home_url( '/#catalog' ) ); ?>">Каталог</a>
|
||||||
<a href="<?php echo esc_url( $blog_url ); ?>">Блог</a>
|
<a href="<?php echo esc_url( $blog_url ); ?>">Блог</a>
|
||||||
<a href="<?php echo esc_url( home_url( '/delivery/' ) ); ?>">Доставка воды в Севастополе</a>
|
<a href="<?php echo esc_url( home_url( '/delivery/' ) ); ?>">Доставка воды в Севастополе</a>
|
||||||
<a href="<?php echo esc_url( home_url( '/service/' ) ); ?>">Доставка воды в офис</a>
|
<a href="<?php echo esc_url( home_url( '/service/' ) ); ?>">Доставка воды в офис</a>
|
||||||
<a href="<?php echo esc_url( home_url( '/faq/' ) ); ?>">Частые вопросы</a>
|
<a href="<?php echo esc_url( home_url( '/faq/' ) ); ?>">Частые вопросы</a>
|
||||||
<a href="<?php echo esc_url( home_url( '/contacts/' ) ); ?>">Контакты</a>
|
<a href="<?php echo esc_url( home_url( '/contacts/' ) ); ?>">Контакты</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="classic-footer-col">
|
<div class="classic-footer-col">
|
||||||
<h3>Документы</h3>
|
<h3>Документы</h3>
|
||||||
<div class="footer-legal">
|
<div class="footer-legal">
|
||||||
<a href="#">Политика конфиденциальности</a>
|
<a href="<?php echo esc_url( twentytwentyfour_privacy_policy_url() ); ?>">Политика конфиденциальности</a>
|
||||||
<a href="#">Пользовательское соглашение</a>
|
<a href="#">Пользовательское соглашение</a>
|
||||||
<a href="#">Условия использования</a>
|
<a href="#">Условия использования</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer-bottom classic-footer-bottom">
|
<div class="footer-bottom classic-footer-bottom">
|
||||||
<span>© 2026 АкваЛиния. Все права защищены.</span>
|
<span>© 2026 АкваЛиния. Все права защищены.</span>
|
||||||
<span>АкваЛиния — питьевая вода с доставкой в Севастополе</span>
|
<span>АкваЛиния — питьевая вода с доставкой в Севастополе</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -326,96 +326,3 @@ add_filter( 'get_the_archive_title', 'water_delivery_category_title' );
|
|||||||
* Load init.
|
* Load init.
|
||||||
*/
|
*/
|
||||||
require_once get_template_directory() . '/inc/init.php';
|
require_once get_template_directory() . '/inc/init.php';
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the privacy policy page without requiring a database page.
|
|
||||||
*/
|
|
||||||
function water_delivery_privacy_policy_template() {
|
|
||||||
if ( is_admin() || empty( $_SERVER['REQUEST_URI'] ) ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$request_path = trim( wp_parse_url( wp_unslash( $_SERVER['REQUEST_URI'] ), PHP_URL_PATH ), '/' );
|
|
||||||
|
|
||||||
if ( 'privacy-policy' === $request_path ) {
|
|
||||||
status_header( 200 );
|
|
||||||
include get_template_directory() . '/privacy-policy.php';
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
add_action( 'template_redirect', 'water_delivery_privacy_policy_template', 0 );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cookie notice and personal data consent controls.
|
|
||||||
*/
|
|
||||||
function water_delivery_privacy_footer_assets() {
|
|
||||||
$privacy_url = esc_url( home_url( '/privacy-policy/' ) );
|
|
||||||
?>
|
|
||||||
<div class="cookie-consent-banner" data-cookie-consent-banner hidden>
|
|
||||||
<p>
|
|
||||||
<?php esc_html_e( 'Мы используем файлы cookie для улучшения работы сайта. Продолжая использовать сайт, Вы соглашаетесь с нашей', 'water-delivery' ); ?>
|
|
||||||
<a href="<?php echo $privacy_url; ?>"><?php esc_html_e( 'Политикой конфиденциальности', 'water-delivery' ); ?></a>.
|
|
||||||
</p>
|
|
||||||
<button type="button" class="cookie-consent-accept" data-cookie-consent-accept><?php esc_html_e( 'Принять', 'water-delivery' ); ?></button>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
(function () {
|
|
||||||
var consentKey = 'water_delivery_cookie_consent';
|
|
||||||
var banner = document.querySelector('[data-cookie-consent-banner]');
|
|
||||||
var acceptButton = document.querySelector('[data-cookie-consent-accept]');
|
|
||||||
var privacyUrl = <?php echo wp_json_encode( $privacy_url ); ?>;
|
|
||||||
var consentHtml = 'Согласен(на) на обработку персональных данных и принимаю <a href="' + privacyUrl + '">Политику конфиденциальности</a>';
|
|
||||||
|
|
||||||
if (banner && localStorage.getItem(consentKey) !== 'accepted') {
|
|
||||||
banner.hidden = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (acceptButton) {
|
|
||||||
acceptButton.addEventListener('click', function () {
|
|
||||||
localStorage.setItem(consentKey, 'accepted');
|
|
||||||
if (banner) {
|
|
||||||
banner.hidden = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
document.querySelectorAll('form').forEach(function (form, index) {
|
|
||||||
var ignored = form.matches('.search-form, .woocommerce-cart-form, form[role="search"]');
|
|
||||||
var hasPersonalFields = form.querySelector('input[type="email"], input[type="tel"], input[name*="phone"], input[name*="email"], textarea, .wpforms-submit, .wpcf7-submit');
|
|
||||||
|
|
||||||
if (ignored || !hasPersonalFields || form.querySelector('.personal-data-consent')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var field = document.createElement('label');
|
|
||||||
field.className = 'personal-data-consent';
|
|
||||||
field.innerHTML = '<input type="checkbox" name="personal_data_consent_' + index + '" required> <span>' + consentHtml + '</span>';
|
|
||||||
|
|
||||||
var submit = form.querySelector('button[type="submit"], input[type="submit"], .wpforms-submit, .wpcf7-submit');
|
|
||||||
if (submit && submit.parentNode) {
|
|
||||||
submit.parentNode.insertBefore(field, submit);
|
|
||||||
} else {
|
|
||||||
form.appendChild(field);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
add_action( 'wp_footer', 'water_delivery_privacy_footer_assets', 20 );
|
|
||||||
|
|
||||||
function water_delivery_comment_privacy_consent_field( $fields ) {
|
|
||||||
$fields['privacy_consent'] = '<p class="comment-form-privacy-consent"><label><input type="checkbox" name="privacy_consent" required> ' . sprintf( wp_kses( __( 'Согласен(на) на обработку персональных данных и принимаю <a href="%s">Политику конфиденциальности</a>', 'water-delivery' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( home_url( '/privacy-policy/' ) ) ) . '</label></p>';
|
|
||||||
|
|
||||||
return $fields;
|
|
||||||
}
|
|
||||||
add_filter( 'comment_form_default_fields', 'water_delivery_comment_privacy_consent_field' );
|
|
||||||
|
|
||||||
function water_delivery_comment_privacy_consent_validate( $commentdata ) {
|
|
||||||
if ( empty( $_POST['privacy_consent'] ) ) {
|
|
||||||
wp_die( esc_html__( 'Необходимо согласиться на обработку персональных данных.', 'water-delivery' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return $commentdata;
|
|
||||||
}
|
|
||||||
add_filter( 'preprocess_comment', 'water_delivery_comment_privacy_consent_validate' );
|
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ if ( ! function_exists( 'water_delivery_footer_section' ) ) :
|
|||||||
?>
|
?>
|
||||||
<div class="copy_right_block">
|
<div class="copy_right_block">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<span class="copy-right"><?php echo esc_html($copyright_footer);?> <a class="footer-privacy-link" href="<?php echo esc_url( home_url( '/privacy-policy/' ) ); ?>"><?php esc_html_e( 'Политика конфиденциальности', 'water-delivery' ); ?></a><?php echo $powered_by_text;?></span>
|
<span class="copy-right"><?php echo esc_html($copyright_footer);?><?php echo $powered_by_text;?></span>
|
||||||
</div><!-- .wrapper -->
|
</div><!-- .wrapper -->
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- .site-info -->
|
</div> <!-- .site-info -->
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Template for the privacy policy page.
|
|
||||||
*
|
|
||||||
* @package Water Delivery
|
|
||||||
*/
|
|
||||||
|
|
||||||
get_header();
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div id="primary" class="content-area privacy-policy-page">
|
|
||||||
<main id="main" class="site-main" role="main">
|
|
||||||
<article class="privacy-policy-content">
|
|
||||||
<header class="entry-header">
|
|
||||||
<h1 class="entry-title"><?php esc_html_e( 'Политика конфиденциальности', 'water-delivery' ); ?></h1>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="entry-content">
|
|
||||||
<?php
|
|
||||||
$policy_file = get_template_directory() . '/privacy-policy-content.txt';
|
|
||||||
$policy_text = file_exists( $policy_file ) ? file_get_contents( $policy_file ) : '';
|
|
||||||
|
|
||||||
if ( ! empty( $policy_text ) ) {
|
|
||||||
$policy_text = str_replace( array( "\r\n", "\r" ), "\n", $policy_text );
|
|
||||||
$paragraphs = preg_split( "/\n{2,}/", trim( $policy_text ) );
|
|
||||||
|
|
||||||
foreach ( $paragraphs as $paragraph ) {
|
|
||||||
$paragraph = trim( $paragraph );
|
|
||||||
|
|
||||||
if ( '' === $paragraph ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<p>' . nl2br( esc_html( $paragraph ) ) . '</p>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
get_footer();
|
|
||||||
@@ -59,87 +59,6 @@ Nicolas Gallagher and Jonathan Neal http://necolas.github.io/normalize.css/
|
|||||||
|
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
|
|
||||||
.privacy-policy-page .privacy-policy-content {
|
|
||||||
max-width: 980px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 60px 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.privacy-policy-page .entry-title {
|
|
||||||
margin-bottom: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.privacy-policy-page .entry-content p {
|
|
||||||
margin-bottom: 18px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-privacy-link {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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(0, 0, 0, 0.12);
|
|
||||||
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
|
|
||||||
}
|
|
||||||
|
|
||||||
.cookie-consent-banner[hidden] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cookie-consent-banner p {
|
|
||||||
margin: 0;
|
|
||||||
color: #333;
|
|
||||||
line-height: 1.45;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cookie-consent-accept {
|
|
||||||
flex: 0 0 auto;
|
|
||||||
padding: 10px 20px;
|
|
||||||
border: 0;
|
|
||||||
background: #fcb614;
|
|
||||||
color: #000;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data-consent,
|
|
||||||
.comment-form-privacy-consent {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: 8px;
|
|
||||||
margin: 14px 0;
|
|
||||||
color: #333;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.45;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data-consent input,
|
|
||||||
.comment-form-privacy-consent input {
|
|
||||||
width: auto;
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 767px) {
|
|
||||||
.cookie-consent-banner {
|
|
||||||
right: 12px;
|
|
||||||
bottom: 12px;
|
|
||||||
left: 12px;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: stretch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------
|
/*--------------------------------------------------------------
|
||||||
# Normalize
|
# Normalize
|
||||||
--------------------------------------------------------------*/
|
--------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user