47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
|
|
if (! defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
$f_title = dekart_family_get('family_price_title');
|
|
$f_note = dekart_family_get('family_price_note');
|
|
|
|
$src_id = 0;
|
|
$cards = array();
|
|
|
|
$school_id = function_exists('dekart_page_id_by_template') ? dekart_page_id_by_template('page-elementary-school.php') : 0;
|
|
if ($school_id) {
|
|
$c = carbon_get_post_meta($school_id, 'price_cards');
|
|
if (! empty($c) && is_array($c)) {
|
|
$src_id = $school_id;
|
|
$cards = $c;
|
|
}
|
|
}
|
|
if (! $cards) {
|
|
$home_id = (int) get_option('page_on_front');
|
|
if ($home_id) {
|
|
$c = carbon_get_post_meta($home_id, 'price_cards');
|
|
if (! empty($c) && is_array($c)) {
|
|
$src_id = $home_id;
|
|
$cards = $c;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (empty($cards) || ! is_array($cards)) {
|
|
return;
|
|
}
|
|
|
|
get_template_part('template-parts/price-front', null, array(
|
|
'post_id' => $src_id,
|
|
'label' => 'Стоимость',
|
|
'title' => $f_title ?: 'Стоимость обучения в семейном классе',
|
|
'desc' => '',
|
|
'section_id' => 'family-price',
|
|
'cta_goal' => 'family_classes_cta',
|
|
'cta_track' => 'family-price-cta',
|
|
'note' => $f_note,
|
|
));
|