diff --git a/wp-content/themes/dekart/page-camp.php b/wp-content/themes/dekart/page-camp.php index ba15484..57bd42d 100644 --- a/wp-content/themes/dekart/page-camp.php +++ b/wp-content/themes/dekart/page-camp.php @@ -11,15 +11,7 @@ get_header(); $post_id = get_the_ID(); $theme_uri = get_template_directory_uri(); -$priceMin = 1000000; -$programs = carbon_get_post_meta($post_id, 'programs' ); - -if (is_array($programs)) { - foreach ($programs as $item) { - $price = (int)$item['programs_price']; - if ($price < $priceMin) $priceMin = $price; - } -} +$priceMin = (int)carbon_get_post_meta($post_id, 'price_half_day'); $jsonld_social = array(); $jsonld_social_raw = carbon_get_post_meta( $post_id, 'social_media' ); @@ -277,9 +269,9 @@ $metrics = [ $programs_title = $item['programs_title']; $programs_date = $item['programs_date']; $programs_text = $item['programs_text']; - $programs_price = $item['programs_price']; $programs_days = $item['programs_days']; - $programs_content = $item['programs_content'];?> + $programs_content = $item['programs_content']; + $programs_price_global = carbon_get_post_meta($post_id, 'price_half_day');?>
<?php echo $programs_img && get_post_meta($programs_img, '_wp_attachment_image_alt', true) ? esc_attr(get_post_meta($programs_img, '_wp_attachment_image_alt', true)) : esc_attr($programs_title) . ' — Образовательный центр Декарт ' . $city; ?>
@@ -287,8 +279,8 @@ $metrics = [

@@ -754,6 +746,7 @@ if (preg_match("/\\(window,document,'([^']+)'\\)/", $_b24_raw, $_m)) $_b24_url = // ───────────────────────────────────────────────────────────── // JSON-LD: Event (смены) + FAQ + AggregateRating (отзывы) // ───────────────────────────────────────────────────────────── +$programs = carbon_get_post_meta($post_id, 'programs'); $ld_events = array(); if ( is_array( $programs ) ) { foreach ( $programs as $item ) { @@ -774,10 +767,11 @@ if ( is_array( $programs ) ) { if ( ! empty( $item['programs_img'] ) ) { $ev['image'] = esc_url( wp_get_attachment_url( $item['programs_img'] ) ); } - if ( ! empty( $item['programs_price'] ) ) { + $_half_price = (int)carbon_get_post_meta($post_id, 'price_half_day'); + if ( $_half_price > 0 ) { $ev['offers'] = array( '@type' => 'Offer', - 'price' => (int) $item['programs_price'], + 'price' => $_half_price, 'priceCurrency' => 'RUB', ); }