| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
// Group Discounts Section |
| 7 |
// Expected variables: $trip |
| 8 |
?> |
| 9 |
<section class="yatra-group-discounts-section" id="group-discounts"> |
| 10 |
<div class="yatra-group-discounts-container"> |
| 11 |
<div class="yatra-group-discounts-header"> |
| 12 |
<h2 class="yatra-group-discounts-title"> |
| 13 |
<?php echo yatra_svg_icon('users', 'yatra-group-discounts-icon'); ?> |
| 14 |
<?php echo esc_html__('Group Discounts Available', 'yatra'); ?> |
| 15 |
</h2> |
| 16 |
<p class="yatra-group-discounts-subtitle"> |
| 17 |
<?php echo esc_html__('Save money when traveling with a group. The more people, the better the deal!', 'yatra'); ?> |
| 18 |
</p> |
| 19 |
</div> |
| 20 |
|
| 21 |
<div class="yatra-group-discounts-grid"> |
| 22 |
<?php foreach ($group_discounts_data as $discount): ?> |
| 23 |
<div class="yatra-group-discount-card"> |
| 24 |
<div class="yatra-group-discount-header"> |
| 25 |
<div class="yatra-group-discount-range"> |
| 26 |
<span class="yatra-group-size"><?php echo esc_html($discount['range_label']); ?></span> |
| 27 |
</div> |
| 28 |
<div class="yatra-group-discount-amount"> |
| 29 |
<span class="yatra-discount-text"><?php echo esc_html($discount['discount_label']); ?></span> |
| 30 |
</div> |
| 31 |
</div> |
| 32 |
|
| 33 |
<div class="yatra-group-discount-details"> |
| 34 |
<?php if ($discount['discount_mode'] === 'category_based' && !empty($discount['category_discounts'])): ?> |
| 35 |
<div class="yatra-category-discounts"> |
| 36 |
<h4><?php echo esc_html__('Category-Based Savings', 'yatra'); ?></h4> |
| 37 |
<div class="yatra-category-breakdown"> |
| 38 |
<?php foreach ($discount['category_discounts'] as $category => $details): ?> |
| 39 |
<div class="yatra-category-item"> |
| 40 |
<span class="yatra-category-name"><?php echo esc_html(ucfirst($category)); ?>:</span> |
| 41 |
<span class="yatra-category-saving"> |
| 42 |
<?php |
| 43 |
printf( |
| 44 |
/* translators: 1: discount amount, 2: percent symbol or empty */ |
| 45 |
esc_html__('%1$s%2$s off', 'yatra'), |
| 46 |
esc_html($details['discount_rate']), |
| 47 |
$details['discount_type'] === 'percentage' ? '%' : '' |
| 48 |
); |
| 49 |
?> |
| 50 |
</span> |
| 51 |
</div> |
| 52 |
<?php endforeach; ?> |
| 53 |
</div> |
| 54 |
</div> |
| 55 |
<?php else: ?> |
| 56 |
<div class="yatra-total-discount-info"> |
| 57 |
<p><?php echo esc_html__('Discount applies to the entire booking total.', 'yatra'); ?></p> |
| 58 |
</div> |
| 59 |
<?php endif; ?> |
| 60 |
</div> |
| 61 |
|
| 62 |
<div class="yatra-group-discount-cta"> |
| 63 |
<button type="button" class="yatra-group-discount-btn" data-group-size="<?php echo esc_attr($discount['min_group_size']); ?>"> |
| 64 |
<?php echo esc_html__('Book for', 'yatra'); ?> <?php echo esc_html($discount['min_group_size']); ?>+ |
| 65 |
</button> |
| 66 |
</div> |
| 67 |
</div> |
| 68 |
<?php endforeach; ?> |
| 69 |
</div> |
| 70 |
|
| 71 |
<div class="yatra-group-discounts-footer"> |
| 72 |
<div class="yatra-group-benefits"> |
| 73 |
<h3><?php echo esc_html__('Why Travel in a Group?', 'yatra'); ?></h3> |
| 74 |
<div class="yatra-group-benefits-grid"> |
| 75 |
<div class="yatra-benefit-item"> |
| 76 |
<div class="yatra-benefit-icon"> |
| 77 |
<?php echo yatra_svg_icon('dollar-sign', 'yatra-icon-sm'); ?> |
| 78 |
</div> |
| 79 |
<div class="yatra-benefit-content"> |
| 80 |
<h4><?php echo esc_html__('Save Money', 'yatra'); ?></h4> |
| 81 |
<p><?php echo esc_html__('Group discounts can save you hundreds per person.', 'yatra'); ?></p> |
| 82 |
</div> |
| 83 |
</div> |
| 84 |
<div class="yatra-benefit-item"> |
| 85 |
<div class="yatra-benefit-icon"> |
| 86 |
<?php echo yatra_svg_icon('users', 'yatra-icon-sm'); ?> |
| 87 |
</div> |
| 88 |
<div class="yatra-benefit-content"> |
| 89 |
<h4><?php echo esc_html__('Share the Experience', 'yatra'); ?></h4> |
| 90 |
<p><?php echo esc_html__('Travel with friends, family, or colleagues.', 'yatra'); ?></p> |
| 91 |
</div> |
| 92 |
</div> |
| 93 |
<div class="yatra-benefit-item"> |
| 94 |
<div class="yatra-benefit-icon"> |
| 95 |
<?php echo yatra_svg_icon('heart', 'yatra-icon-sm'); ?> |
| 96 |
</div> |
| 97 |
<div class="yatra-benefit-content"> |
| 98 |
<h4><?php echo esc_html__('Special Treatment', 'yatra'); ?></h4> |
| 99 |
<p><?php echo esc_html__('Groups often get priority service and attention.', 'yatra'); ?></p> |
| 100 |
</div> |
| 101 |
</div> |
| 102 |
</div> |
| 103 |
</div> |
| 104 |
|
| 105 |
<div class="yatra-group-discounts-note"> |
| 106 |
<p> |
| 107 |
<?php echo yatra_svg_icon('info', 'yatra-icon-xs'); ?> |
| 108 |
<?php echo esc_html__('Group discounts are applied automatically when you select the required number of travelers. No coupon codes needed!', 'yatra'); ?> |
| 109 |
</p> |
| 110 |
</div> |
| 111 |
</div> |
| 112 |
</div> |
| 113 |
</section> |
| 114 |
|