2026-07-27 17:00:30 +00:00

49 lines
2.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Sticky CTA — shared template part
*
* Mobile: always visible, fixed bottom
* Desktop: hidden until hero scrolls out of view, then slides up
*
* @package Dekart
*/
if (! defined('ABSPATH')) {
exit;
}
$sticky_phone = get_option('branch_phone') ?: carbon_get_theme_option('site_phone') ?: '';
$sticky_clean = $sticky_phone ? preg_replace('/[\s\-\\(\)]/', '', $sticky_phone) : '';
$sticky_text = carbon_get_post_meta(get_the_ID(), 'sticky_cta_text') ?: 'Запишитесь на экскурсию и&nbsp;познакомьтесь со&nbsp;школой лично';
?>
<div class="sticky-cta-mobile" aria-label="Быстрая запись">
<div class="sticky-cta-mobile__inner">
<span class="sticky-cta-mobile__text"><?php echo wp_kses_post($sticky_text); ?></span>
<div class="sticky-cta-mobile__actions">
<button class="sticky-cta-mobile__btn btn-write open-bitrix-form">Записаться</button>
<?php if ($sticky_phone && $sticky_clean) : ?>
<a class="sticky-cta-mobile__phone" href="tel:<?php echo esc_attr($sticky_clean); ?>" aria-label="Позвонить">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
</a>
<?php endif; ?>
</div>
<noscript>
<a class="sticky-cta-mobile__btn" href="tel:<?php echo esc_attr($sticky_clean); ?>">Позвонить</a>
</noscript>
</div>
</div>
<div class="sticky-cta-desktop" aria-label="Быстрая запись">
<div class="sticky-cta-desktop__inner">
<div class="sticky-cta-desktop__info">
<span class="sticky-cta-desktop__badge">🎯 Акция</span>
<span class="sticky-cta-desktop__text"><?php echo wp_kses_post($sticky_text); ?></span>
</div>
<button class="sticky-cta-desktop__btn btn-write open-bitrix-form">Записаться</button>
<noscript>
<a class="sticky-cta-desktop__btn" href="tel:<?php echo esc_attr($sticky_clean); ?>">Позвонить</a>
</noscript>
</div>
</div>