2026-10-08 15:34:25 +00:00

45 lines
2.8 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
// Липкая панель записи
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;познакомьтесь с&nbsp;педагогами лично';
$sticky_is_family = is_page_template('page-semejnye-klassy.php');
$sticky_goal = $sticky_is_family ? 'family_classes_cta' : 'sticky_form';
$sticky_phone_goal = $sticky_is_family ? 'family_classes_phone' : 'sticky_phone';
?>
<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" data-goal="<?php echo esc_attr($sticky_goal); ?>">Записаться</button>
<?php if ($sticky_phone && $sticky_clean) : ?>
<a class="sticky-cta-mobile__phone" href="tel:<?php echo esc_attr($sticky_clean); ?>" aria-label="Позвонить" data-goal="<?php echo esc_attr($sticky_phone_goal); ?>">
<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); ?>" data-goal="<?php echo esc_attr($sticky_phone_goal); ?>">Позвонить</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"><?php echo dekart_icon('target', 16); ?> Акция</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" data-goal="<?php echo esc_attr($sticky_goal); ?>">Записаться</button>
<noscript>
<a class="sticky-cta-desktop__btn" href="tel:<?php echo esc_attr($sticky_clean); ?>" data-goal="<?php echo esc_attr($sticky_phone_goal); ?>">Позвонить</a>
</noscript>
</div>
</div>