| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
<section class="yatra-trip-section" id="what-makes-special"> |
| 7 |
<h2 class="yatra-trip-section-title"> |
| 8 |
<?php yatra_render_tab_icon($tab->icon ?? null, 'star', 'yatra-trip-section-title-icon', $tab->label ?? __('What Makes This Trip Special', 'yatra')); ?> |
| 9 |
<?php echo esc_html(isset($tab->label) ? $tab->label : __('What Makes This Trip Special', 'yatra')); ?> |
| 10 |
</h2> |
| 11 |
<div class="yatra-trip-special-container"> |
| 12 |
<div class="yatra-trip-special-content"> |
| 13 |
<div class="yatra-special-features"> |
| 14 |
<?php |
| 15 |
$special_content = $trip->getWhatMakesSpecial() ?? ''; |
| 16 |
if (!empty($special_content)) { |
| 17 |
// Split content by lines and create feature items |
| 18 |
$features = preg_split('/\r\n|\r|\n/', $special_content); |
| 19 |
$features = array_filter($features, function($line) { |
| 20 |
return !empty(trim($line)); |
| 21 |
}); |
| 22 |
|
| 23 |
if (!empty($features)) { |
| 24 |
foreach ($features as $index => $feature) { |
| 25 |
$feature = trim($feature); |
| 26 |
if (!empty($feature)) { |
| 27 |
?> |
| 28 |
<div class="yatra-special-feature-item"> |
| 29 |
<div class="yatra-special-feature-icon"> |
| 30 |
<?php echo yatra_svg_icon('check-circle', 'yatra-feature-check'); ?> |
| 31 |
</div> |
| 32 |
<div class="yatra-special-feature-text"> |
| 33 |
<?php echo wp_kses_post($feature); ?> |
| 34 |
</div> |
| 35 |
</div> |
| 36 |
<?php |
| 37 |
} |
| 38 |
} |
| 39 |
} else { |
| 40 |
// Fallback to simple paragraph if no line breaks |
| 41 |
?> |
| 42 |
<div class="yatra-special-feature-item"> |
| 43 |
<div class="yatra-special-feature-icon"> |
| 44 |
<?php echo yatra_svg_icon('star', 'yatra-feature-check'); ?> |
| 45 |
</div> |
| 46 |
<div class="yatra-special-feature-text"> |
| 47 |
<?php echo wp_kses_post($special_content); ?> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
<?php |
| 51 |
} |
| 52 |
} else { |
| 53 |
echo '<p class="yatra-no-content">' . esc_html__('No special features listed for this trip yet.', 'yatra') . '</p>'; |
| 54 |
} |
| 55 |
?> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
|
| 59 |
<?php if (!empty($special_content)): ?> |
| 60 |
<div class="yatra-special-badge"> |
| 61 |
<?php echo yatra_svg_icon('award', 'yatra-badge-icon'); ?> |
| 62 |
<span><?php echo esc_html__('Premium Experience', 'yatra'); ?></span> |
| 63 |
</div> |
| 64 |
<?php endif; ?> |
| 65 |
</div> |
| 66 |
</section> |