PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.2.6
Yatra – Travel Booking & Tour Operator Software v3.0.2.6
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / templates / booking-confirmation.php

booking-confirmation.php in Yatra – Travel Booking & Tour Operator Software 3.0.2.6, at templates/booking-confirmation.php

1,010 lines 40.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Booking Confirmation Template
4 *
5 * Displays booking confirmation after successful booking
6 *
7 * @package Yatra
8 *
9 * Global variables available:
10 * - $booking_data or $GLOBALS['yatra_booking']
11 */
12
13 if (!defined('ABSPATH')) {
14 exit;
15 }
16
17 // Get booking data
18 $booking = $GLOBALS['yatra_booking'] ?? null;
19
20 if (!$booking) {
21 wp_safe_redirect(home_url('/'));
22 exit;
23 }
24
25 // Completed booking: ensure checkout session and its transient cannot repopulate the booking form.
26 if (function_exists('yatra_clear_booking_session')) {
27 yatra_clear_booking_session();
28 }
29
30 // Format dates
31 $travel_date_formatted = date_i18n(get_option('date_format'), strtotime($booking->travel_date));
32 $booking_date_formatted = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($booking->created_at));
33
34 // Get status color
35 $status_colors = [
36 'pending' => ['bg' => '#fef3c7', 'text' => '#d97706', 'label' => 'Pending'],
37 'confirmed' => ['bg' => '#d1fae5', 'text' => '#059669', 'label' => 'Confirmed'],
38 'processing' => ['bg' => '#dbeafe', 'text' => '#2563eb', 'label' => 'Processing'],
39 'completed' => ['bg' => '#d1fae5', 'text' => '#059669', 'label' => 'Completed'],
40 'cancelled' => ['bg' => '#fee2e2', 'text' => '#dc2626', 'label' => 'Cancelled'],
41 'refunded' => ['bg' => '#fce7f3', 'text' => '#db2777', 'label' => 'Refunded'],
42 'on_hold' => ['bg' => '#e5e7eb', 'text' => '#6b7280', 'label' => 'On Hold'],
43 ];
44
45 $status_style = $status_colors[$booking->status] ?? $status_colors['pending'];
46
47 yatra_get_header();
48
49 // Hook for Pro modules to add custom scripts (Facebook Pixel, etc.)
50 do_action('yatra_booking_confirmation_header', $booking);
51 ?>
52
53 <div class="yatra-wrapper yatra-confirmation-wrapper">
54 <div class="yatra-confirmation-container">
55
56 <!-- Success Header -->
57 <div class="yatra-confirmation-header">
58 <div class="yatra-confirmation-icon">
59 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
60 <circle cx="12" cy="12" r="10"></circle>
61 <polyline points="9,12 12,15 16,10"></polyline>
62 </svg>
63 </div>
64 <h1 class="yatra-confirmation-title">
65 <?php
66 if ($booking->status === 'confirmed') {
67 esc_html_e('Booking Confirmed!', 'yatra');
68 } elseif ($booking->status === 'pending') {
69 esc_html_e('Booking Received!', 'yatra');
70 } elseif ($booking->status === 'cancelled') {
71 esc_html_e('Booking Cancelled', 'yatra');
72 } else {
73 esc_html_e('Booking Submitted!', 'yatra');
74 }
75 ?>
76 </h1>
77 <p class="yatra-confirmation-subtitle">
78 <?php
79 if ($booking->status === 'confirmed') {
80 esc_html_e('Thank you for your booking. We look forward to hosting you!', 'yatra');
81 } elseif ($booking->status === 'pending') {
82 esc_html_e('Thank you for your booking. Your booking is pending confirmation.', 'yatra');
83 } elseif ($booking->status === 'cancelled') {
84 esc_html_e('This booking has been cancelled.', 'yatra');
85 } else {
86 esc_html_e('Thank you for your booking submission.', 'yatra');
87 }
88 ?>
89 </p>
90 <div class="yatra-confirmation-reference">
91 <span class="yatra-ref-label"><?php esc_html_e('Booking Reference:', 'yatra'); ?></span>
92 <span class="yatra-ref-code"><?php echo esc_html($booking->reference); ?></span>
93 </div>
94 </div>
95
96 <?php
97 // Resolve featured image URL (handle attachment ID or direct URL)
98 $featured_image_url = '';
99 if (!empty($booking->featured_image)) {
100 if (is_numeric($booking->featured_image)) {
101 $featured_image_url = wp_get_attachment_url((int) $booking->featured_image) ?: '';
102 } else {
103 $featured_image_url = $booking->featured_image;
104 }
105 }
106 ?>
107
108 <div class="yatra-confirmation-content">
109 <!-- Trip Summary Card -->
110 <div class="yatra-confirmation-card yatra-trip-summary-card">
111 <div class="yatra-trip-summary">
112 <?php if (!empty($featured_image_url)) : ?>
113 <div class="yatra-trip-image">
114 <img src="<?php echo esc_url($featured_image_url); ?>" alt="<?php echo esc_attr($booking->trip_title); ?>">
115 </div>
116 <?php endif; ?>
117
118 <div class="yatra-trip-info">
119 <h2 class="yatra-trip-name"><?php echo esc_html($booking->trip_title); ?></h2>
120
121 <?php if (!empty($booking->trip_average_rating) && $booking->trip_review_count >= 0) : ?>
122 <div class="yatra-trip-rating">
123 <div class="yatra-rating-stars">
124 <?php
125 $filled_stars = floor($booking->trip_average_rating);
126 $has_half = ($booking->trip_average_rating - $filled_stars) >= 0.5;
127 for ($i = 1; $i <= 5; $i++) :
128 $class = $i <= $filled_stars ? 'yatra-star-filled' : ($has_half && $i === $filled_stars + 1 ? 'yatra-star-half' : '');
129 ?>
130 <span class="yatra-star <?php echo esc_attr($class); ?>">
131 <svg viewBox="0 0 24 24" fill="currentColor"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26"></polygon></svg>
132 </span>
133 <?php endfor; ?>
134 </div>
135 <div class="yatra-rating-meta">
136 <strong><?php echo esc_html(number_format($booking->trip_average_rating, 1)); ?></strong>
137 <span>
138 <?php
139 /* translators: %d review count */
140 printf(esc_html(_n('%d Review', '%d Reviews', (int) $booking->trip_review_count, 'yatra')), (int) $booking->trip_review_count);
141 ?>
142 </span>
143 </div>
144 </div>
145 <?php endif; ?>
146
147 <div class="yatra-trip-meta">
148 <?php if (!empty($booking->duration_days)) : ?>
149 <span class="yatra-meta-item">
150 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
151 <circle cx="12" cy="12" r="10"></circle>
152 <polyline points="12 6 12 12 16 14"></polyline>
153 </svg>
154 <?php printf(esc_html__('%d Days / %d Nights', 'yatra'), (int) $booking->duration_days, (int) $booking->duration_nights); ?>
155 </span>
156 <?php endif; ?>
157
158 <?php if (!empty($booking->difficulty_level)) : ?>
159 <span class="yatra-meta-item">
160 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
161 <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>
162 </svg>
163 <?php echo esc_html(ucfirst($booking->difficulty_level)); ?>
164 </span>
165 <?php endif; ?>
166 </div>
167
168 <?php if (!empty($booking->starting_location)) : ?>
169 <p class="yatra-trip-location">
170 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
171 <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path>
172 <circle cx="12" cy="10" r="3"></circle>
173 </svg>
174 <?php echo esc_html($booking->starting_location); ?>
175 <?php if (!empty($booking->ending_location) && $booking->ending_location !== $booking->starting_location) : ?>
176 → <?php echo esc_html($booking->ending_location); ?>
177 <?php endif; ?>
178 </p>
179 <?php endif; ?>
180
181 <?php if (!empty($booking->trip_destinations_list)) : ?>
182 <div class="yatra-trip-tags">
183 <span class="yatra-tag-label"><?php esc_html_e('Destinations:', 'yatra'); ?></span>
184 <div class="yatra-tag-group">
185 <?php foreach ($booking->trip_destinations_list as $destination) : ?>
186 <span class="yatra-tag-item"><?php echo esc_html($destination); ?></span>
187 <?php endforeach; ?>
188 </div>
189 </div>
190 <?php endif; ?>
191
192 <?php if (!empty($booking->trip_activities_list)) : ?>
193 <div class="yatra-trip-tags">
194 <span class="yatra-tag-label"><?php esc_html_e('Activities:', 'yatra'); ?></span>
195 <div class="yatra-tag-group">
196 <?php foreach ($booking->trip_activities_list as $activity) : ?>
197 <span class="yatra-tag-item"><?php echo esc_html($activity); ?></span>
198 <?php endforeach; ?>
199 </div>
200 </div>
201 <?php endif; ?>
202
203 <?php if (!empty($booking->trip_categories_list)) : ?>
204 <div class="yatra-trip-tags">
205 <span class="yatra-tag-label"><?php esc_html_e('Trip Type:', 'yatra'); ?></span>
206 <div class="yatra-tag-group">
207 <?php foreach ($booking->trip_categories_list as $category) : ?>
208 <span class="yatra-tag-item"><?php echo esc_html($category); ?></span>
209 <?php endforeach; ?>
210 </div>
211 </div>
212 <?php endif; ?>
213
214 <?php if (!empty($booking->trip_attributes_list)) : ?>
215 <div class="yatra-trip-tags">
216 <span class="yatra-tag-label"><?php esc_html_e('Features:', 'yatra'); ?></span>
217 <div class="yatra-tag-group">
218 <?php foreach ($booking->trip_attributes_list as $attribute) : ?>
219 <span class="yatra-tag-item yatra-attribute-tag"><?php echo esc_html($attribute); ?></span>
220 <?php endforeach; ?>
221 </div>
222 </div>
223 <?php endif; ?>
224 </div>
225 </div>
226 </div>
227
228 <!-- Booking Details -->
229 <div class="yatra-confirmation-grid">
230 <!-- Left Column -->
231 <div class="yatra-confirmation-column">
232 <!-- Booking Info Card -->
233 <div class="yatra-confirmation-card">
234 <h3 class="yatra-card-title">
235 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
236 <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
237 <line x1="16" y1="2" x2="16" y2="6"></line>
238 <line x1="8" y1="2" x2="8" y2="6"></line>
239 <line x1="3" y1="10" x2="21" y2="10"></line>
240 </svg>
241 <?php esc_html_e('Booking Information', 'yatra'); ?>
242 </h3>
243
244 <div class="yatra-info-grid">
245 <div class="yatra-info-item">
246 <span class="yatra-info-label"><?php esc_html_e('Status', 'yatra'); ?></span>
247 <span class="yatra-info-value">
248 <span class="yatra-status-badge" style="background: <?php echo esc_attr($status_style['bg']); ?>; color: <?php echo esc_attr($status_style['text']); ?>;">
249 <?php echo esc_html($status_style['label']); ?>
250 </span>
251 </span>
252 </div>
253 <div class="yatra-info-item">
254 <span class="yatra-info-label"><?php esc_html_e('Travel Date', 'yatra'); ?></span>
255 <span class="yatra-info-value"><?php echo esc_html($travel_date_formatted); ?></span>
256 </div>
257 <div class="yatra-info-item">
258 <span class="yatra-info-label"><?php esc_html_e('Number of Travelers', 'yatra'); ?></span>
259 <span class="yatra-info-value"><?php echo esc_html($booking->travelers_count); ?></span>
260 </div>
261 <div class="yatra-info-item">
262 <span class="yatra-info-label"><?php esc_html_e('Booked On', 'yatra'); ?></span>
263 <span class="yatra-info-value"><?php echo esc_html($booking_date_formatted); ?></span>
264 </div>
265 </div>
266 </div>
267
268 <!-- Travelers Card -->
269 <?php if (!empty($booking->travelers)) : ?>
270 <div class="yatra-confirmation-card">
271 <h3 class="yatra-card-title">
272 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
273 <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
274 <circle cx="9" cy="7" r="4"></circle>
275 <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
276 <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
277 </svg>
278 <?php esc_html_e('Travelers', 'yatra'); ?>
279 </h3>
280
281 <div class="yatra-travelers-list">
282 <?php foreach ($booking->travelers as $index => $traveler) :
283 $traveler_name = trim(($traveler['first_name'] ?? '') . ' ' . ($traveler['last_name'] ?? ''));
284 ?>
285 <div class="yatra-traveler-item">
286 <span class="yatra-traveler-number"><?php echo esc_html($index + 1); ?></span>
287 <div class="yatra-traveler-details">
288 <span class="yatra-traveler-name">
289 <?php echo esc_html($traveler_name ?: __('Traveler', 'yatra') . ' ' . ($index + 1)); ?>
290 </span>
291 <?php if (!empty($traveler['date_of_birth'])) : ?>
292 <span class="yatra-traveler-dob">
293 <?php echo esc_html(date_i18n(get_option('date_format'), strtotime($traveler['date_of_birth']))); ?>
294 </span>
295 <?php endif; ?>
296 </div>
297 </div>
298 <?php endforeach; ?>
299 </div>
300 </div>
301 <?php endif; ?>
302
303 <?php
304 // Allow gateways to inject cards (e.g., Bank Transfer instructions)
305 do_action('yatra_booking_confirmation_after_details', $booking);
306 ?>
307 </div>
308
309 <!-- Right Column -->
310 <div class="yatra-confirmation-column">
311 <!-- Payment Summary Card -->
312 <div class="yatra-confirmation-card yatra-payment-card">
313 <h3 class="yatra-card-title">
314 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
315 <rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect>
316 <line x1="1" y1="10" x2="23" y2="10"></line>
317 </svg>
318 <?php esc_html_e('Payment Summary', 'yatra'); ?>
319 </h3>
320
321 <div class="yatra-payment-rows">
322 <?php
323 // Get subtotal (gross amount before tax)
324 $subtotal = !empty($booking->subtotal) ? (float) $booking->subtotal : (float) $booking->total_amount;
325 $tax_amount = !empty($booking->tax_amount) ? (float) $booking->tax_amount : 0;
326 $tax_inclusive = !empty($booking->tax_inclusive);
327
328 // If tax is inclusive, subtotal should be total_amount, otherwise calculate it
329 if (!$tax_inclusive && $tax_amount > 0) {
330 $subtotal = $booking->total_amount - $tax_amount;
331 }
332 ?>
333
334 <!-- Gross Total (base trip cost before services/discounts/taxes) -->
335 <div class="yatra-payment-row">
336 <span><strong><?php esc_html_e('Gross Total', 'yatra'); ?></strong></span>
337 <span><strong><?php echo esc_html(yatra_format_price($subtotal, $booking->currency)); ?></strong></span>
338 </div>
339
340 <?php if (!empty($booking->discount_amount) && $booking->discount_amount > 0) : ?>
341 <!-- Discount -->
342 <div class="yatra-payment-row yatra-discount-row">
343 <span><?php esc_html_e('Discount', 'yatra'); ?></span>
344 <span style="color: #059669; font-weight: 500;">-<?php echo esc_html(yatra_format_price($booking->discount_amount, $booking->currency)); ?></span>
345 </div>
346 <?php endif; ?>
347
348 <!-- Itinerary Costs -->
349 <?php
350 $itinerary_costs = [];
351 if (!empty($booking->itinerary_costs)) {
352 $itinerary_costs = json_decode($booking->itinerary_costs, true) ?: [];
353 }
354
355 if (!empty($itinerary_costs)):
356 ?>
357 <div class="yatra-payment-row">
358 <span><strong><?php esc_html_e('Itinerary Costs', 'yatra'); ?></strong></span>
359 <span></span>
360 </div>
361 <?php foreach ($itinerary_costs as $cost): ?>
362 <div class="yatra-payment-row" style="margin-left: 20px;">
363 <span>
364 <?php echo esc_html($cost['name']); ?>
365 <?php if (!empty($cost['price_per'])) : ?>
366 <small style="opacity: 0.7;">
367 <?php
368 if ($cost['price_per'] === 'person') {
369 esc_html_e('(per person)', 'yatra');
370 } elseif ($cost['price_per'] === 'group') {
371 esc_html_e('(per booking)', 'yatra');
372 } else {
373 esc_html_e('(flat rate)', 'yatra');
374 }
375 ?>
376 </small>
377 <?php endif; ?>
378 </span>
379 <span><?php echo esc_html(yatra_format_price($cost['total_cost'] ?? $cost['price'], $booking->currency)); ?></span>
380 </div>
381 <?php endforeach; ?>
382 <?php endif; ?>
383
384 <!-- Taxable Amount (SubTotal - amount that tax is calculated on) -->
385 <?php
386 $taxable_amount = 0;
387 if (!empty($booking->itinerary_costs_total)) {
388 // Calculate taxable amount: discounted subtotal + itinerary costs
389 $discounted_subtotal = $subtotal - ($booking->discount_amount ?? 0);
390 $taxable_amount = $discounted_subtotal + (float) $booking->itinerary_costs_total;
391 }
392
393 if ($taxable_amount > 0 && !empty($tax_breakdown)):
394 ?>
395 <div class="yatra-payment-row" style="border-top: 1px dashed #e5e7eb; margin-top: 8px; padding-top: 8px;">
396 <span><strong><?php esc_html_e('Subtotal (Taxable Amount)', 'yatra'); ?></strong></span>
397 <span><strong><?php echo esc_html(yatra_format_price($taxable_amount, $booking->currency)); ?></strong></span>
398 </div>
399 <?php endif; ?>
400
401 <!-- Tax Breakdown -->
402 <?php
403 $tax_breakdown = [];
404 if (!empty($booking->tax_details)) {
405 $taxes = json_decode($booking->tax_details, true) ?: [];
406 foreach ($taxes as $tax) {
407 $tax_breakdown[] = [
408 'name' => $tax['name'] ?? 'Tax',
409 'rate' => $tax['rate'] ?? 0,
410 'amount' => $tax['amount'] ?? 0
411 ];
412 }
413 } elseif (!empty($booking->tax_amount) && $booking->tax_amount > 0) {
414 // Fallback for single tax
415 $tax_breakdown[] = [
416 'name' => __('Tax', 'yatra'),
417 'rate' => (float) ($booking->tax_rate ?? 0),
418 'amount' => (float) $booking->tax_amount
419 ];
420 }
421
422 if (!empty($tax_breakdown)):
423 ?>
424 <?php foreach ($tax_breakdown as $tax): ?>
425 <div class="yatra-payment-row">
426 <span><?php echo esc_html($tax['name']); ?> (<?php echo esc_html($tax['rate']); ?>%)</span>
427 <span><?php echo esc_html(yatra_format_price($tax['amount'], $booking->currency)); ?></span>
428 </div>
429 <?php endforeach; ?>
430 <?php endif; ?>
431
432 <!-- Net Amount -->
433 <div class="yatra-payment-row">
434 <span><strong><?php esc_html_e('Net Amount', 'yatra'); ?></strong></span>
435 <span><strong><?php echo esc_html(yatra_format_price($booking->total_amount, $booking->currency)); ?></strong></span>
436 </div>
437
438 <?php if (($booking->amount_paid ?? 0) > 0) : ?>
439 <!-- Amount Paid -->
440 <div class="yatra-payment-row">
441 <span><?php esc_html_e('Amount Paid', 'yatra'); ?></span>
442 <span><?php echo esc_html(yatra_format_price($booking->amount_paid, $booking->currency)); ?></span>
443 </div>
444 <?php endif; ?>
445
446 <?php if ($booking->amount_due > 0) : ?>
447 <!-- Due Now -->
448 <div class="yatra-payment-row yatra-due-row">
449 <span><?php esc_html_e('Due Now', 'yatra'); ?></span>
450 <span><?php echo esc_html(yatra_format_price($booking->amount_due, $booking->currency)); ?></span>
451 </div>
452 <?php endif; ?>
453 </div>
454
455 <div class="yatra-payment-method">
456 <span class="yatra-pm-label"><?php esc_html_e('Payment Method:', 'yatra'); ?></span>
457 <span class="yatra-pm-value"><?php echo esc_html(ucwords(str_replace('_', ' ', $booking->payment_gateway))); ?></span>
458 </div>
459 </div>
460
461 <!-- Contact Info Card -->
462 <div class="yatra-confirmation-card">
463 <h3 class="yatra-card-title">
464 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
465 <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>
466 <polyline points="22,6 12,13 2,6"></polyline>
467 </svg>
468 <?php esc_html_e('Contact Information', 'yatra'); ?>
469 </h3>
470
471 <div class="yatra-contact-info">
472 <?php
473 // Try to get contact data from multiple sources
474 $contact_data = [];
475 if (!empty($booking->contact_data)) {
476 $contact_data = json_decode($booking->contact_data, true) ?: [];
477 }
478
479 $contact_name = trim((
480 $contact_data['first_name'] ??
481 $booking->contact_first_name ??
482 ($booking->contact['first_name'] ?? '')
483 ) . ' ' . (
484 $contact_data['last_name'] ??
485 $booking->contact_last_name ??
486 ($booking->contact['last_name'] ?? '')
487 ));
488
489 $contact_email = $contact_data['email'] ?? $booking->contact_email ?? ($booking->contact['email'] ?? '');
490 $contact_phone = $contact_data['phone'] ?? $booking->contact_phone ?? ($booking->contact['phone'] ?? '');
491 ?>
492
493 <?php if ($contact_name) : ?>
494 <p class="yatra-contact-item">
495 <strong><?php esc_html_e('Name:', 'yatra'); ?></strong>
496 <?php echo esc_html($contact_name); ?>
497 </p>
498 <?php endif; ?>
499
500 <?php if ($contact_email) : ?>
501 <p class="yatra-contact-item">
502 <strong><?php esc_html_e('Email:', 'yatra'); ?></strong>
503 <?php echo esc_html($contact_email); ?>
504 </p>
505 <?php endif; ?>
506
507 <?php if ($contact_phone) : ?>
508 <p class="yatra-contact-item">
509 <strong><?php esc_html_e('Phone:', 'yatra'); ?></strong>
510 <?php echo esc_html($contact_phone); ?>
511 </p>
512 <?php endif; ?>
513
514 <?php if (!$contact_name && !$contact_email && !$contact_phone) : ?>
515 <p class="yatra-contact-item">
516 <em><?php esc_html_e('Contact information not available', 'yatra'); ?></em>
517 </p>
518 <?php endif; ?>
519 </div>
520 </div>
521 </div>
522 </div>
523
524 <!-- What's Next Section -->
525 <div class="yatra-confirmation-card yatra-whats-next">
526 <h3 class="yatra-card-title">
527 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
528 <circle cx="12" cy="12" r="10"></circle>
529 <polyline points="12 16 16 12 12 8"></polyline>
530 <line x1="8" y1="12" x2="16" y2="12"></line>
531 </svg>
532 <?php esc_html_e("What's Next?", 'yatra'); ?>
533 </h3>
534
535 <div class="yatra-next-steps">
536 <div class="yatra-step">
537 <span class="yatra-step-number">1</span>
538 <div class="yatra-step-content">
539 <h4><?php esc_html_e('Check Your Email', 'yatra'); ?></h4>
540 <p><?php esc_html_e('We\'ve sent a confirmation email with all the details to your registered email address.', 'yatra'); ?></p>
541 </div>
542 </div>
543
544 <div class="yatra-step">
545 <span class="yatra-step-number">2</span>
546 <div class="yatra-step-content">
547 <h4><?php esc_html_e('Detailed Itinerary', 'yatra'); ?></h4>
548 <p><?php esc_html_e('You\'ll receive a detailed itinerary and preparation guide within 24-48 hours.', 'yatra'); ?></p>
549 </div>
550 </div>
551
552 <div class="yatra-step">
553 <span class="yatra-step-number">3</span>
554 <div class="yatra-step-content">
555 <h4><?php esc_html_e('Prepare for Adventure', 'yatra'); ?></h4>
556 <p><?php esc_html_e('Ensure all travelers have valid ID or travel documents and any required visas for your destination.', 'yatra'); ?></p>
557 </div>
558 </div>
559 </div>
560 </div>
561
562 <!-- Action Buttons -->
563 <div class="yatra-confirmation-actions">
564 <a href="<?php echo esc_url(home_url('/')); ?>" class="yatra-btn yatra-btn-secondary">
565 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
566 <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
567 <polyline points="9 22 9 12 15 12 15 22"></polyline>
568 </svg>
569 <?php esc_html_e('Return to Home', 'yatra'); ?>
570 </a>
571
572 <?php
573 // Get latest payment for this booking to enable invoice download
574 $paymentRepository = new \Yatra\Repositories\PaymentRepository();
575 $latestPayment = $paymentRepository->findLatestByBookingId((int) $booking->id);
576 if ($latestPayment && in_array($latestPayment->status, ['completed', 'paid'], true)) :
577 ?>
578 <a href="<?php echo esc_url(rest_url('yatra/v1/payment/' . $latestPayment->id . '/invoice')); ?>"
579 target="_blank"
580 class="yatra-btn yatra-btn-primary">
581 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
582 <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
583 <polyline points="7 10 12 15 17 10"></polyline>
584 <line x1="12" y1="15" x2="12" y2="3"></line>
585 </svg>
586 <?php esc_html_e('Download Invoice', 'yatra'); ?>
587 </a>
588 <?php endif; ?>
589
590 <button onclick="window.print();" class="yatra-btn yatra-btn-outline">
591 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
592 <polyline points="6 9 6 2 18 2 18 9"></polyline>
593 <path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path>
594 <rect x="6" y="14" width="12" height="8"></rect>
595 </svg>
596 <?php esc_html_e('Print Confirmation', 'yatra'); ?>
597 </button>
598 </div>
599
600 </div>
601 </div>
602 </div>
603
604 <style>
605 /* Confirmation Page Styles */
606 .yatra-confirmation-wrapper {
607 max-width: 1300px;
608 margin: 0 auto;
609 padding: 40px 20px;
610 }
611
612 .yatra-confirmation-container {
613 max-width: 900px;
614 margin: 0 auto;
615 }
616
617 .yatra-confirmation-header {
618 text-align: center;
619 margin-bottom: 40px;
620 }
621
622 .yatra-confirmation-icon {
623 width: 100px;
624 height: 100px;
625 margin: 0 auto 24px;
626 background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
627 border-radius: 50%;
628 display: flex;
629 align-items: center;
630 justify-content: center;
631 animation: scaleIn 0.5s ease-out;
632 }
633
634 .yatra-confirmation-icon svg {
635 width: 50px;
636 height: 50px;
637 color: white;
638 }
639
640 @keyframes scaleIn {
641 0% { transform: scale(0); opacity: 0; }
642 50% { transform: scale(1.1); }
643 100% { transform: scale(1); opacity: 1; }
644 }
645
646 .yatra-confirmation-title {
647 font-size: 36px;
648 font-weight: 700;
649 color: #111827;
650 margin: 0 0 12px;
651 }
652
653 .yatra-confirmation-subtitle {
654 font-size: 18px;
655 color: #6b7280;
656 margin: 0 0 24px;
657 }
658
659 .yatra-confirmation-reference {
660 display: inline-flex;
661 align-items: center;
662 gap: 12px;
663 background: #f3f4f6;
664 padding: 12px 24px;
665 border-radius: 100px;
666 }
667
668 .yatra-ref-label {
669 color: #6b7280;
670 font-size: 14px;
671 }
672
673 .yatra-ref-code {
674 font-size: 18px;
675 font-weight: 700;
676 color: #111827;
677 font-family: monospace;
678 letter-spacing: 1px;
679 }
680
681 .yatra-confirmation-card {
682 background: #fff;
683 border: 1px solid #e5e7eb;
684 border-radius: 16px;
685 padding: 24px;
686 margin-bottom: 24px;
687 }
688
689 .yatra-card-title {
690 display: flex;
691 align-items: center;
692 gap: 12px;
693 font-size: 18px;
694 font-weight: 600;
695 color: #111827;
696 margin: 0 0 20px;
697 padding-bottom: 16px;
698 border-bottom: 1px solid #e5e7eb;
699 }
700
701 .yatra-card-title svg {
702 width: 22px;
703 height: 22px;
704 color: #3b82f6;
705 }
706
707 .yatra-trip-summary-card {
708 background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
709 border-color: #bfdbfe;
710 }
711
712 .yatra-trip-summary {
713 display: flex;
714 gap: 24px;
715 align-items: center;
716 }
717
718 .yatra-trip-image {
719 width: 120px;
720 height: 120px;
721 border-radius: 12px;
722 overflow: hidden;
723 flex-shrink: 0;
724 }
725
726 .yatra-trip-image img {
727 width: 100%;
728 height: 100%;
729 object-fit: cover;
730 }
731
732 .yatra-trip-name {
733 font-size: 22px;
734 font-weight: 700;
735 color: #111827;
736 margin: 0 0 12px;
737 }
738
739 .yatra-trip-meta {
740 display: flex;
741 gap: 20px;
742 flex-wrap: wrap;
743 margin-bottom: 8px;
744 }
745
746 .yatra-meta-item {
747 display: flex;
748 align-items: center;
749 gap: 6px;
750 font-size: 14px;
751 color: #4b5563;
752 }
753
754 .yatra-meta-item svg {
755 width: 16px;
756 height: 16px;
757 }
758
759 .yatra-trip-location {
760 display: flex;
761 align-items: center;
762 gap: 6px;
763 font-size: 14px;
764 color: #6b7280;
765 margin: 0;
766 }
767
768 .yatra-trip-location svg {
769 width: 16px;
770 height: 16px;
771 }
772
773 .yatra-confirmation-grid {
774 display: grid;
775 grid-template-columns: 1fr 1fr;
776 gap: 24px;
777 }
778
779 @media (max-width: 768px) {
780 .yatra-confirmation-grid {
781 grid-template-columns: 1fr;
782 }
783
784 .yatra-trip-summary {
785 flex-direction: column;
786 text-align: center;
787 }
788 }
789
790 .yatra-info-grid {
791 display: grid;
792 grid-template-columns: 1fr 1fr;
793 gap: 16px;
794 }
795
796 .yatra-info-item {
797 display: flex;
798 flex-direction: column;
799 gap: 4px;
800 }
801
802 .yatra-info-label {
803 font-size: 13px;
804 color: #6b7280;
805 }
806
807 .yatra-info-value {
808 font-size: 15px;
809 font-weight: 600;
810 color: #111827;
811 }
812
813 .yatra-status-badge {
814 display: inline-block;
815 padding: 4px 12px;
816 border-radius: 100px;
817 font-size: 13px;
818 font-weight: 600;
819 }
820
821 .yatra-travelers-list {
822 display: flex;
823 flex-direction: column;
824 gap: 12px;
825 }
826
827 .yatra-traveler-item {
828 display: flex;
829 align-items: center;
830 gap: 12px;
831 padding: 12px;
832 background: #f9fafb;
833 border-radius: 8px;
834 }
835
836 .yatra-traveler-number {
837 width: 28px;
838 height: 28px;
839 display: flex;
840 align-items: center;
841 justify-content: center;
842 background: #3b82f6;
843 color: white;
844 border-radius: 50%;
845 font-size: 13px;
846 font-weight: 600;
847 }
848
849 .yatra-traveler-name {
850 font-weight: 600;
851 color: #111827;
852 }
853
854 .yatra-traveler-dob {
855 font-size: 13px;
856 color: #6b7280;
857 }
858
859 .yatra-payment-card {
860 background: #fafafa;
861 }
862
863 .yatra-payment-rows {
864 border: 1px solid #e5e7eb;
865 border-radius: 8px;
866 overflow: hidden;
867 }
868
869 .yatra-payment-row {
870 display: flex;
871 justify-content: space-between;
872 padding: 12px 16px;
873 border-bottom: 1px solid #e5e7eb;
874 }
875
876 .yatra-payment-row:last-child {
877 border-bottom: none;
878 background: #111827;
879 color: white;
880 font-weight: 600;
881 }
882
883 .yatra-discount-row span:last-child {
884 color: #22c55e;
885 }
886
887 .yatra-payment-method {
888 margin-top: 16px;
889 padding: 12px;
890 background: white;
891 border-radius: 8px;
892 display: flex;
893 justify-content: space-between;
894 }
895
896 .yatra-pm-label {
897 color: #6b7280;
898 }
899
900 .yatra-pm-value {
901 font-weight: 600;
902 color: #111827;
903 }
904
905 .yatra-contact-info p {
906 margin: 0 0 8px;
907 }
908
909 .yatra-whats-next {
910 background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
911 border-color: #bbf7d0;
912 }
913
914 .yatra-next-steps {
915 display: flex;
916 flex-direction: column;
917 gap: 20px;
918 }
919
920 .yatra-step {
921 display: flex;
922 gap: 16px;
923 }
924
925 .yatra-step-number {
926 width: 32px;
927 height: 32px;
928 display: flex;
929 align-items: center;
930 justify-content: center;
931 background: #22c55e;
932 color: white;
933 border-radius: 50%;
934 font-weight: 600;
935 flex-shrink: 0;
936 }
937
938 .yatra-step-content h4 {
939 margin: 0 0 4px;
940 font-size: 16px;
941 color: #111827;
942 }
943
944 .yatra-step-content p {
945 margin: 0;
946 font-size: 14px;
947 color: #6b7280;
948 }
949
950 .yatra-confirmation-actions {
951 display: flex;
952 gap: 16px;
953 justify-content: center;
954 margin-top: 32px;
955 }
956
957 .yatra-btn {
958 display: inline-flex;
959 align-items: center;
960 gap: 8px;
961 padding: 14px 28px;
962 border-radius: 8px;
963 font-size: 15px;
964 font-weight: 600;
965 text-decoration: none;
966 cursor: pointer;
967 transition: all 0.2s;
968 border: none;
969 }
970
971 .yatra-btn svg {
972 width: 18px;
973 height: 18px;
974 }
975
976 .yatra-btn-secondary {
977 background: #3b82f6;
978 color: white;
979 }
980
981 .yatra-btn-secondary:hover {
982 background: #2563eb;
983 }
984
985 .yatra-btn-outline {
986 background: white;
987 color: #374151;
988 border: 2px solid #e5e7eb;
989 }
990
991 .yatra-btn-outline:hover {
992 border-color: #3b82f6;
993 color: #3b82f6;
994 }
995
996 /* Print Styles */
997 @media print {
998 .yatra-confirmation-actions {
999 display: none;
1000 }
1001
1002 .yatra-confirmation-wrapper {
1003 padding: 0;
1004 }
1005 }
1006 </style>
1007
1008 <?php yatra_get_footer(); ?>
1009
1010