87 lines
4.4 KiB
PHP
87 lines
4.4 KiB
PHP
<?php
|
||
/**
|
||
* Shared header for test1-related WooCommerce pages.
|
||
*
|
||
* @package Twenty_Twenty_Four
|
||
*/
|
||
|
||
$test1_header_action_url = isset( $test1_header_action_url ) ? $test1_header_action_url : '';
|
||
$test1_header_action_label = isset( $test1_header_action_label ) ? $test1_header_action_label : '';
|
||
$test1_header_mode = isset( $test1_header_mode ) ? $test1_header_mode : 'link';
|
||
$posts_page_id = (int) get_option( 'page_for_posts' );
|
||
$blog_url = $posts_page_id > 0 ? get_permalink( $posts_page_id ) : home_url( '/blog/' );
|
||
|
||
if ( ! $blog_url ) {
|
||
$blog_url = home_url( '/blog/' );
|
||
}
|
||
|
||
$blog_is_active = is_home() || is_singular( 'post' ) || is_category() || is_tag() || is_author() || is_date();
|
||
?>
|
||
<header class="site-header">
|
||
<div class="container">
|
||
<div class="header-row">
|
||
<a class="brand" href="<?php echo esc_url( home_url( '/' ) ); ?>" aria-label="Перейти на главную страницу">
|
||
<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">
|
||
<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"/>
|
||
</svg>
|
||
</span>
|
||
<span class="brand-text">
|
||
<strong>АкваЛиния</strong>
|
||
<span>доставка воды в Севастополе</span>
|
||
</span>
|
||
</a>
|
||
|
||
<nav class="nav" aria-label="Основная навигация">
|
||
<a href="<?php echo esc_url( home_url( '/shop/' ) ); ?>">Каталог</a>
|
||
<a class="<?php echo esc_attr( $blog_is_active ? 'is-active' : '' ); ?>" 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( '/service/' ) ); ?>">Для дома и офиса</a>
|
||
<a href="<?php echo esc_url( home_url( '/faq/' ) ); ?>">FAQ</a>
|
||
<a href="<?php echo esc_url( home_url( '/contacts/' ) ); ?>">Контакты</a>
|
||
</nav>
|
||
|
||
<div class="header-actions">
|
||
<a class="header-phone" href="tel:+79117748923">
|
||
<span aria-hidden="true">+7 (911) 774-89-23</span>
|
||
</a>
|
||
<?php if ( 'cart' === $test1_header_mode ) : ?>
|
||
<button class="cart-button" id="cartOpenButton" aria-label="Открыть корзину">
|
||
<span aria-hidden="true">Корзина</span>
|
||
<span class="cart-count" id="cartCount" aria-live="polite" aria-atomic="true">0</span>
|
||
</button>
|
||
<button class="mobile-toggle" id="mobileToggle" aria-label="Открыть меню" aria-expanded="false" aria-controls="mobilePanel">
|
||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||
<path d="M4 7H20" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||
<path d="M4 12H20" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||
<path d="M4 17H20" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||
</svg>
|
||
</button>
|
||
<?php elseif ( $test1_header_action_url && $test1_header_action_label ) : ?>
|
||
<a class="cart-button checkout-back-link" href="<?php echo esc_url( $test1_header_action_url ); ?>"><span><?php echo esc_html( $test1_header_action_label ); ?></span></a>
|
||
<?php endif; ?>
|
||
</div>
|
||
</div>
|
||
|
||
<?php if ( 'cart' === $test1_header_mode ) : ?>
|
||
<div class="mobile-panel" id="mobilePanel">
|
||
<div class="mobile-card">
|
||
<nav class="mobile-nav" aria-label="Мобильная навигация">
|
||
<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( home_url( '/delivery/' ) ); ?>">Условия доставки</a>
|
||
<a href="<?php echo esc_url( home_url( '/service/' ) ); ?>">Для дома и офиса</a>
|
||
<a href="<?php echo esc_url( home_url( '/faq/' ) ); ?>">FAQ</a>
|
||
<a href="<?php echo esc_url( home_url( '/contacts/' ) ); ?>">Контакты</a>
|
||
</nav>
|
||
<a class="header-phone" href="tel:+79117748923">+7 (911) 774-89-23</a>
|
||
<button class="cart-button" id="mobileCartOpenButton" aria-label="Открыть корзину с мобильного меню">
|
||
<span>Корзина</span>
|
||
<span class="cart-count" id="mobileCartCount" aria-live="polite" aria-atomic="true">0</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<?php endif; ?>
|
||
</div>
|
||
</header>
|