| @@ -1515,11 +1515,13 @@ | ||
| 1515 | 1515 | |
| 1516 | 1516 | // Fetch availability dates using centralized resolution service |
| 1517 | 1517 | $resolutionService = new \Yatra\Services\AvailabilityResolutionService(); |
| 1518 | 1518 | |
| 1519 | - // Always show all dates from today onwards (selected_date is only for highlighting) | |
| 1519 | + // Always show all dates from today onwards (selected_date is only for | |
| 1520 | + // highlighting), up to the configurable booking horizon (Settings → | |
| 1521 | + // Booking; 12 months unless changed — the previous hard-coded value). | |
| 1520 | 1522 | $fromDate = date('Y-m-d'); |
| 1521 | - $toDate = date('Y-m-d', strtotime('+12 months')); | |
| 1523 | + $toDate = yatra_get_availability_horizon_date($fromDate); | |
| 1522 | 1524 | |
| 1523 | 1525 | $availability_dates = $resolutionService->getAllAvailabilityDates($id, $fromDate, $toDate, \Yatra\Services\SettingsService::isEnabled('show_sold_out')); |
| 1524 | 1526 | |
| 1525 | 1527 | // Determine if this is a day trip |
| @@ -1593,8 +1595,11 @@ | ||
| 1593 | 1595 | 'discounted_price' => isset($trip->discounted_price) ? (float) $trip->discounted_price : 0, |
| 1594 | 1596 | 'sale_price' => isset($trip->sale_price) ? (float) $trip->sale_price : 0, |
| 1595 | 1597 | 'currency' => SettingsService::getCurrency(), |
| 1596 | 1598 | 'duration_days' => isset($trip->duration_days) ? (int) $trip->duration_days : 1, |
| 1599 | + // Hour-based day tours show "8 Hours" instead of "1 Day" on the | |
| 1600 | + // availability cards. 0 for every existing (day-based) trip. | |
| 1601 | + 'duration_hours' => isset($trip->duration_hours) ? (int) $trip->duration_hours : 0, | |
| 1597 | 1602 | 'max_travelers' => isset($trip->max_travelers) ? (int) $trip->max_travelers : 20, |
| 1598 | 1603 | 'min_travelers' => isset($trip->min_travelers) ? (int) $trip->min_travelers : 1, |
| 1599 | 1604 | 'pricing_type' => $trip->pricing_type ?? 'regular', |
| 1600 | 1605 | 'price_types' => $trip->price_types ?? [], // Include price_types for traveler-based pricing |