2026-10-08 13:23:09 +00:00

70 lines
4.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
// Секция цен (главная/школа) — с параметрами для лендингов формата
$post_id = isset($args['post_id']) ? (int) $args['post_id'] : get_the_ID();
$pf_label = isset($args['label']) ? (string) $args['label'] : 'Стоимость';
$pf_title = isset($args['title']) ? (string) $args['title'] : 'Стоимость обучения в частной школе «Декарт»';
$pf_desc = isset($args['desc']) ? (string) $args['desc'] : 'Прозрачные цены — никаких скрытых платежей.';
$pf_id = isset($args['section_id']) ? (string) $args['section_id'] : 'price';
$pf_goal = isset($args['cta_goal']) ? (string) $args['cta_goal'] : '';
$pf_track = isset($args['cta_track']) ? (string) $args['cta_track'] : 'price-cta';
$pf_note = isset($args['note']) ? (string) $args['note'] : '';
$price_cards = carbon_get_post_meta($post_id, 'price_cards');
if (empty($price_cards) || ! is_array($price_cards)) {
return;
}
?>
<section class="price-block section-bg reveal" data-bg="price-block" id="<?php echo esc_attr($pf_id); ?>">
<div class="container">
<div class="section-header--centered">
<span class="bento-label"><?php echo esc_html($pf_label); ?></span>
<h2 class="bento-h2"><?php echo esc_html($pf_title); ?></h2>
<?php if ($pf_desc) : ?>
<p class="bento-p"><?php echo esc_html($pf_desc); ?></p>
<?php endif; ?>
</div>
<div class="price-block__scroll-hint" aria-hidden="true">👆 Листайте карточки →</div>
<div class="price-block__wrap">
<div class="price-block__grid">
<?php foreach ($price_cards as $card) :
$card_class = $card['class_name'] ?? '';
$card_price = $card['price'] ?? '';
$card_feats = $card['features'] ?? '';
$card_feats = array_filter(explode("\n", str_replace("\r", '', $card_feats)));
?>
<div class="price-block__card">
<?php if ($card_class) : ?>
<div class="price-block__class"><?php echo esc_html($card_class); ?></div>
<?php endif; ?>
<?php if ($card_price) : ?>
<div class="price-block__amount">
<span class="price-block__value"><?php echo esc_html($card_price); ?></span>
<span class="price-block__label">Стоимость обучения в месяц</span>
</div>
<?php endif; ?>
<?php if (! empty($card_feats)) : ?>
<div class="price-block__features">
<?php foreach ($card_feats as $feat) : ?>
<span class="price-block__feature">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
<?php echo esc_html(trim($feat)); ?>
</span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<button class="price-block__btn btn-write open-bitrix-form" data-track="<?php echo esc_attr($pf_track); ?>"<?php echo $pf_goal ? ' data-goal="' . esc_attr($pf_goal) . '"' : ''; ?>>Записаться</button>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="price-block__extras">
<p class="price-block__extras-item"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg> <span>Можно оплатить <strong>материнским капиталом</strong></span></p>
<p class="price-block__extras-item"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg> <span>Возвращаем <strong>налоговый вычет 13%</strong> от стоимости обучения</span></p>
</div>
<?php if ($pf_note) : ?>
<p class="family-price__note"><?php echo esc_html($pf_note); ?></p>
<?php endif; ?>
</div>
</section>