| @@ -823,9 +823,15 @@ | ||
| 823 | 823 | 'trip_title' => $trip ? ($trip->title ?? $booking['trip_title'] ?? __('Trip Booking', 'yatra')) : ($booking['trip_title'] ?? __('Trip Booking', 'yatra')), |
| 824 | 824 | // Trip duration comes from duration_days/duration_nights (there is no |
| 825 | 825 | // `duration` column — accessing it caused a blank value + PHP notice). |
| 826 | 826 | 'trip_duration' => $trip |
| 827 | - ? yatra_format_duration((int) ($trip->duration_days ?? 0), isset($trip->duration_nights) ? (int) $trip->duration_nights : null) | |
| 827 | + ? yatra_format_duration( | |
| 828 | + (int) ($trip->duration_days ?? 0), | |
| 829 | + isset($trip->duration_nights) ? (int) $trip->duration_nights : null, | |
| 830 | + // Hour-based day tours: "8 hours" instead of "1 day". Absent | |
| 831 | + // or NULL on every day-based trip, which keeps its wording. | |
| 832 | + (int) ($trip->duration_hours ?? 0) | |
| 833 | + ) | |
| 828 | 834 | : '', |
| 829 | 835 | 'trip_difficulty' => $trip ? ($trip->difficulty_name ?? '') : '', |
| 830 | 836 | 'departure_location' => $trip ? ($trip->departure_location ?? '') : '', |
| 831 | 837 | 'destination' => $trip ? ($trip->destination ?? '') : '', |