| @@ -34,11 +34,14 @@ | ||
| 34 | 34 | <?php // Rating is expressed via JSON-LD (Product.aggregateRating) in SEOService — no microdata here, which Google rejected on a TouristTrip parent. ?> |
| 35 | 35 | <div class="yatra-hero-rating"> |
| 36 | 36 | <?php if ($trip->getAverageRating() > 0 || $trip->getReviewCount() > 0): ?> |
| 37 | 37 | <?php |
| 38 | + // Shared helper, so the hero, the reviews block below it and the | |
| 39 | + // booking confirmation all draw the same rating identically. | |
| 38 | 40 | $hero_avg = (float) $trip->getAverageRating(); |
| 39 | - $hero_full = (int) floor($hero_avg); | |
| 40 | - $hero_half = ($hero_avg - $hero_full) >= 0.3; | |
| 41 | + $hero_parts = yatra_rating_star_parts($hero_avg); | |
| 42 | + $hero_full = $hero_parts['full']; | |
| 43 | + $hero_half = $hero_parts['half']; | |
| 41 | 44 | ?> |
| 42 | 45 | <div class="yatra-rating-stars"> |
| 43 | 46 | <?php for ($i = 1; $i <= 5; $i++) : ?> |
| 44 | 47 | <?php |
| @@ -80,14 +83,17 @@ | ||
| 80 | 83 | <?php echo yatra_svg_icon('map-pin', 'yatra-icon-sm'); ?> |
| 81 | 84 | <span itemprop="name"><?php echo esc_html($trip->getStartingLocation()); ?></span> |
| 82 | 85 | </div> |
| 83 | 86 | <?php endif; ?> |
| 84 | - <?php if (!empty($trip->getDurationDays())): ?> | |
| 87 | + <?php if (!empty($trip->getDurationDays()) || $trip->getDurationHours() > 0): ?> | |
| 85 | 88 | <div class="yatra-hero-duration" itemprop="duration"> |
| 86 | 89 | <?php echo yatra_svg_icon('clock', 'yatra-icon-sm'); ?> |
| 87 | 90 | <span> |
| 88 | - <?php | |
| 89 | - if (!empty($trip->getDurationNights()) && $trip->getDurationNights() > 0) { | |
| 91 | + <?php | |
| 92 | + if ($trip->getDurationHours() > 0) { | |
| 93 | + // Hour-based day tour: "8 hours", not "1 day" (matches quick-facts). | |
| 94 | + echo esc_html(yatra_format_duration(0, null, $trip->getDurationHours())); | |
| 95 | + } elseif (!empty($trip->getDurationNights()) && $trip->getDurationNights() > 0) { | |
| 90 | 96 | echo esc_html(sprintf( |
| 91 | 97 | /* translators: 1: number of days, 2: number of nights. */ |
| 92 | 98 | _n('%1$d day %2$d night', '%1$d days %2$d nights', $trip->getDurationDays(), 'yatra'), |
| 93 | 99 | $trip->getDurationDays(), |