правки test1
This commit is contained in:
@@ -23,6 +23,12 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.test1-shared-contacts-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
.test1-shared-cart-page .site-main {
|
.test1-shared-cart-page .site-main {
|
||||||
flex: 1 0 auto;
|
flex: 1 0 auto;
|
||||||
}
|
}
|
||||||
@@ -32,6 +38,11 @@
|
|||||||
padding-bottom: 26px;
|
padding-bottom: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.test1-shared-contacts-page .site-main {
|
||||||
|
flex: 1 0 auto;
|
||||||
|
padding-bottom: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
.test1-shared-cart-page .classic-footer {
|
.test1-shared-cart-page .classic-footer {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
}
|
}
|
||||||
@@ -40,6 +51,10 @@
|
|||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.test1-shared-contacts-page .classic-footer {
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.test1-shared-shell .site-header {
|
.test1-shared-shell .site-header {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
(() => {
|
||||||
|
const contactForm = document.getElementById('contactForm')
|
||||||
|
const contactSuccess = document.getElementById('contactSuccess')
|
||||||
|
|
||||||
|
if (!contactForm || !contactSuccess) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
contactForm.addEventListener('submit', event => {
|
||||||
|
event.preventDefault()
|
||||||
|
contactSuccess.classList.add('visible')
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
contactForm.reset()
|
||||||
|
contactSuccess.classList.remove('visible')
|
||||||
|
}, 2200)
|
||||||
|
})
|
||||||
|
})()
|
||||||
@@ -251,6 +251,29 @@ function twentytwentyfour_faq_template( $template ) {
|
|||||||
}
|
}
|
||||||
add_filter( 'template_include', 'twentytwentyfour_faq_template' );
|
add_filter( 'template_include', 'twentytwentyfour_faq_template' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use a standalone PHP template for the page slug "contacts".
|
||||||
|
*
|
||||||
|
* @since Twenty Twenty-Four 1.0
|
||||||
|
*
|
||||||
|
* @param string $template Resolved template path.
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function twentytwentyfour_contacts_template( $template ) {
|
||||||
|
if ( ! is_page( 'contacts' ) ) {
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
|
|
||||||
|
$custom_template = get_theme_file_path( 'page-contacts.php' );
|
||||||
|
|
||||||
|
if ( file_exists( $custom_template ) ) {
|
||||||
|
return $custom_template;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
|
add_filter( 'template_include', 'twentytwentyfour_contacts_template' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use a lightweight custom template for the WooCommerce checkout page.
|
* Use a lightweight custom template for the WooCommerce checkout page.
|
||||||
*
|
*
|
||||||
@@ -304,7 +327,7 @@ add_filter( 'template_include', 'twentytwentyfour_cart_template', 20 );
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function twentytwentyfour_test1_assets() {
|
function twentytwentyfour_test1_assets() {
|
||||||
$use_test1_assets = is_page( array( 'test1', 'faq' ) );
|
$use_test1_assets = is_page( array( 'test1', 'faq', 'contacts' ) );
|
||||||
|
|
||||||
if ( ! $use_test1_assets ) {
|
if ( ! $use_test1_assets ) {
|
||||||
return;
|
return;
|
||||||
@@ -372,6 +395,20 @@ function twentytwentyfour_test1_assets() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( is_page( 'contacts' ) ) {
|
||||||
|
$contacts_js_file = get_theme_file_path( 'assets/js/test1-contacts.js' );
|
||||||
|
|
||||||
|
if ( file_exists( $contacts_js_file ) ) {
|
||||||
|
wp_enqueue_script(
|
||||||
|
'twentytwentyfour-test1-contacts-script',
|
||||||
|
get_theme_file_uri( 'assets/js/test1-contacts.js' ),
|
||||||
|
array(),
|
||||||
|
(string) filemtime( $contacts_js_file ),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 );
|
add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 );
|
||||||
|
|
||||||
@@ -382,7 +419,7 @@ add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 );
|
|||||||
* @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() ) || is_page( 'faq' ) ) ) {
|
if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || is_page( 'faq' ) || is_page( 'contacts' ) ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
88
wp-content/themes/twentytwentyfour/page-contacts.php
Normal file
88
wp-content/themes/twentytwentyfour/page-contacts.php
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Contacts template with shared test1 header/footer.
|
||||||
|
*
|
||||||
|
* @package Twenty_Twenty_Four
|
||||||
|
*/
|
||||||
|
|
||||||
|
?><!DOCTYPE html>
|
||||||
|
<html <?php language_attributes(); ?>>
|
||||||
|
<head>
|
||||||
|
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<?php wp_head(); ?>
|
||||||
|
</head>
|
||||||
|
<body <?php body_class( 'test1-shared-shell test1-shared-contacts-page' ); ?>>
|
||||||
|
<?php wp_body_open(); ?>
|
||||||
|
<?php
|
||||||
|
$test1_header_action_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' );
|
||||||
|
$test1_header_action_label = __( 'Корзина', 'twentytwentyfour' );
|
||||||
|
$test1_header_mode = 'link';
|
||||||
|
require get_theme_file_path( 'template-parts/test1-shared-header.php' );
|
||||||
|
?>
|
||||||
|
|
||||||
|
<main class="site-main" role="main">
|
||||||
|
<section class="section" id="contacts">
|
||||||
|
<div class="container">
|
||||||
|
<div class="section-head">
|
||||||
|
<div>
|
||||||
|
<span class="eyebrow"><?php esc_html_e( 'Контакты', 'twentytwentyfour' ); ?></span>
|
||||||
|
<h1 class="section-title"><?php esc_html_e( 'Свяжитесь с нами и оформите заказ в пару минут', 'twentytwentyfour' ); ?></h1>
|
||||||
|
</div>
|
||||||
|
<p class="section-copy"><?php esc_html_e( 'Оставьте заявку на доставку воды в Севастополе: подскажем по объему, подтвердим удобное окно и сразу уточним детали по таре и подъему.', 'twentytwentyfour' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="contacts-grid">
|
||||||
|
<div class="contact-card reveal">
|
||||||
|
<h3><?php esc_html_e( 'Контактные данные', 'twentytwentyfour' ); ?></h3>
|
||||||
|
<ul class="contact-list">
|
||||||
|
<li><strong><?php esc_html_e( 'Телефон:', 'twentytwentyfour' ); ?></strong> <a href="tel:+79781234567">+7 (978) 123-45-67</a></li>
|
||||||
|
<li><strong><?php esc_html_e( 'Адрес:', 'twentytwentyfour' ); ?></strong> <?php esc_html_e( 'г. Севастополь, ул. Генерала Острякова, 92', 'twentytwentyfour' ); ?></li>
|
||||||
|
<li><strong><?php esc_html_e( 'График:', 'twentytwentyfour' ); ?></strong> <?php esc_html_e( 'ежедневно с 8:00 до 21:00', 'twentytwentyfour' ); ?></li>
|
||||||
|
<li><strong><?php esc_html_e( 'E-mail:', 'twentytwentyfour' ); ?></strong> <a href="mailto:order@aqualinia-sev.ru">order@aqualinia-sev.ru</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<form class="contact-form" id="contactForm">
|
||||||
|
<input class="field" type="text" name="name" 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>
|
||||||
|
<textarea class="field" name="comment" placeholder="<?php esc_attr_e( 'Что нужно доставить: например, 2 бутыли 19 л и 1 упаковка 1.5 л', 'twentytwentyfour' ); ?>" aria-label="<?php esc_attr_e( 'Комментарий к заказу', 'twentytwentyfour' ); ?>"></textarea>
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="map-placeholder reveal reveal-delay-1" aria-label="Условия обслуживания по городу">
|
||||||
|
<span class="eyebrow eyebrow-inverse"><?php esc_html_e( 'Зона обслуживания', 'twentytwentyfour' ); ?></span>
|
||||||
|
<h3 class="section-heading-compact section-heading-map"><?php esc_html_e( 'Принимаем заявки по всему Севастополю', 'twentytwentyfour' ); ?></h3>
|
||||||
|
<p class="map-copy"><?php esc_html_e( 'Работаем ежедневно и подбираем удобный интервал доставки для дома, офиса, кафе и небольших коммерческих точек.', 'twentytwentyfour' ); ?></p>
|
||||||
|
|
||||||
|
<div class="contact-fast-facts">
|
||||||
|
<article class="contact-fact-card">
|
||||||
|
<strong><?php esc_html_e( 'Подтверждение заявки', 'twentytwentyfour' ); ?></strong>
|
||||||
|
<span><?php esc_html_e( 'До 15 минут в рабочие часы, без долгого ожидания.', 'twentytwentyfour' ); ?></span>
|
||||||
|
</article>
|
||||||
|
<article class="contact-fact-card">
|
||||||
|
<strong><?php esc_html_e( 'Окна доставки', 'twentytwentyfour' ); ?></strong>
|
||||||
|
<span><?php esc_html_e( 'С 8:00 до 21:00 ежедневно, срочные слоты по возможности.', 'twentytwentyfour' ); ?></span>
|
||||||
|
</article>
|
||||||
|
<article class="contact-fact-card">
|
||||||
|
<strong><?php esc_html_e( 'Дополнительный сервис', 'twentytwentyfour' ); ?></strong>
|
||||||
|
<span><?php esc_html_e( 'Подъем воды и вывоз пустой тары при следующем визите.', 'twentytwentyfour' ); ?></span>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="contact-quick-actions">
|
||||||
|
<a class="contact-quick-link" href="tel:+79781234567"><?php esc_html_e( 'Позвонить: +7 (978) 123-45-67', 'twentytwentyfour' ); ?></a>
|
||||||
|
<a class="contact-quick-link" href="mailto:order@aqualinia-sev.ru"><?php esc_html_e( 'Написать: order@aqualinia-sev.ru', 'twentytwentyfour' ); ?></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<?php require get_theme_file_path( 'template-parts/test1-shared-footer.php' ); ?>
|
||||||
|
<?php wp_footer(); ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -29,7 +29,7 @@ $test1_header_mode = isset( $test1_header_mode ) ? $test1_header_mode :
|
|||||||
<a href="<?php echo esc_url( home_url( '/test1/#delivery' ) ); ?>">Доставка</a>
|
<a href="<?php echo esc_url( home_url( '/test1/#delivery' ) ); ?>">Доставка</a>
|
||||||
<a href="<?php echo esc_url( home_url( '/test1/#business' ) ); ?>">Для дома и офиса</a>
|
<a href="<?php echo esc_url( home_url( '/test1/#business' ) ); ?>">Для дома и офиса</a>
|
||||||
<a href="<?php echo esc_url( home_url( '/test1/#faq' ) ); ?>">FAQ</a>
|
<a href="<?php echo esc_url( home_url( '/test1/#faq' ) ); ?>">FAQ</a>
|
||||||
<a href="<?php echo esc_url( home_url( '/test1/#contacts' ) ); ?>">Контакты</a>
|
<a href="<?php echo esc_url( home_url( '/contacts/' ) ); ?>">Контакты</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
@@ -61,8 +61,8 @@ $test1_header_mode = isset( $test1_header_mode ) ? $test1_header_mode :
|
|||||||
<a href="#catalog">Каталог</a>
|
<a href="#catalog">Каталог</a>
|
||||||
<a href="#delivery">Условия доставки</a>
|
<a href="#delivery">Условия доставки</a>
|
||||||
<a href="#business">Для дома и офиса</a>
|
<a href="#business">Для дома и офиса</a>
|
||||||
<a href="#faq">FAQ</a>
|
<a href="<?php echo esc_url( home_url( '/faq/' ) ); ?>">FAQ</a>
|
||||||
<a href="#contacts">Контакты</a>
|
<a href="<?php echo esc_url( home_url( '/contacts/' ) ); ?>">Контакты</a>
|
||||||
</nav>
|
</nav>
|
||||||
<a class="header-phone" href="tel:+79781234567">+7 (978) 123-45-67</a>
|
<a class="header-phone" href="tel:+79781234567">+7 (978) 123-45-67</a>
|
||||||
<button class="cart-button" id="mobileCartOpenButton" aria-label="Открыть корзину с мобильного меню">
|
<button class="cart-button" id="mobileCartOpenButton" aria-label="Открыть корзину с мобильного меню">
|
||||||
|
|||||||
Reference in New Issue
Block a user