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

61 lines
3.5 KiB
PHP

<?php
/**
* Price cards section for front page
* Uses CF complex field `price_cards` from page meta
*/
$post_id = get_the_ID();
$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="price">
<div class="container">
<div class="section-header--centered">
<span class="bento-label">Стоимость</span>
<h2 class="bento-h2">Стоимость обучения в частной школе «Декарт»</h2>
<p class="bento-p">Прозрачные цены — никаких скрытых платежей.</p>
</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="price-cta">Записаться</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>
</div>
</section>