| @@ -3,8 +3,9 @@ | ||
| 3 | 3 | declare(strict_types=1); |
| 4 | 4 | |
| 5 | 5 | namespace Yatra\Services; |
| 6 | 6 | |
| 7 | +use Yatra\Database\Tables\BookingsTable; | |
| 7 | 8 | use Yatra\Repositories\ItineraryRepository; |
| 8 | 9 | |
| 9 | 10 | /** |
| 10 | 11 | * Itinerary Cost Service |
| @@ -91,14 +92,13 @@ | ||
| 91 | 92 | 'day_number' => $entry->day_number, |
| 92 | 93 | ]; |
| 93 | 94 | } |
| 94 | 95 | |
| 95 | - // error_log('ItineraryCostService - Found ' . count($itineraryCosts) . ' itinerary costs for trip ' . $tripId); | |
| 96 | + // | |
| 96 | 97 | |
| 97 | 98 | return $itineraryCosts; |
| 98 | 99 | |
| 99 | 100 | } catch (\Exception $e) { |
| 100 | - error_log('ItineraryCostService - Error: ' . $e->getMessage()); | |
| 101 | 101 | return []; |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| @@ -128,12 +128,11 @@ | ||
| 128 | 128 | // Add to booking details |
| 129 | 129 | $bookingDetails['itinerary_costs'] = $itineraryCosts; |
| 130 | 130 | $bookingDetails['itinerary_costs_total'] = $itineraryCostsTotal; |
| 131 | 131 | |
| 132 | - // error_log('ItineraryCostService - Added ' . count($itineraryCosts) . ' itinerary costs to booking details for booking ' . $bookingId); | |
| 132 | + // | |
| 133 | 133 | |
| 134 | 134 | } catch (\Exception $e) { |
| 135 | - error_log('ItineraryCostService - Error adding to booking details: ' . $e->getMessage()); | |
| 136 | 135 | } |
| 137 | 136 | |
| 138 | 137 | return $bookingDetails; |
| 139 | 138 | } |
| @@ -149,9 +148,9 @@ | ||
| 149 | 148 | { |
| 150 | 149 | try { |
| 151 | 150 | // Get booking details directly from database to avoid potential loops |
| 152 | 151 | global $wpdb; |
| 153 | - $table_name = $wpdb->prefix . 'yatra_new_bookings'; | |
| 152 | + $table_name = BookingsTable::getTableName(); | |
| 154 | 153 | |
| 155 | 154 | $booking = $wpdb->get_row($wpdb->prepare( |
| 156 | 155 | "SELECT trip_id, travelers_count, travel_date, itinerary_costs FROM {$table_name} WHERE id = %d", |
| 157 | 156 | $bookingId |
| @@ -195,12 +194,11 @@ | ||
| 195 | 194 | 'item_type' => $cost['item_type'] ?? '', |
| 196 | 195 | ]; |
| 197 | 196 | } |
| 198 | 197 | |
| 199 | - // error_log('ItineraryCostService - Added ' . count($itineraryCosts) . ' itinerary costs as services for booking ' . $bookingId); | |
| 198 | + // | |
| 200 | 199 | |
| 201 | 200 | } catch (\Exception $e) { |
| 202 | - error_log('ItineraryCostService - Error getting services: ' . $e->getMessage()); | |
| 203 | 201 | } |
| 204 | 202 | |
| 205 | 203 | return $services; |
| 206 | 204 | } |