PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
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
← All changes | templates/partials/booking-content.php +26 -7 3.0.5 → 3.0.16 View file →
@@ -349,8 +349,10 @@
349 349 'row_attrs' => [
350 350 'data-category-id' => $category_id,
351 351 'data-price' => $category_price,
352 352 'data-pricing-mode' => $pricing_mode,
353 + 'data-group-overflow' => $pt->group_overflow ?? 'block',
354 + 'data-max-pax' => $pt->max_pax ?? '',
353 355 ],
354 356 'minus_disabled' => ($index !== 0 && $count <= 0),
355 357 'plus_disabled' => false,
356 358 'minus_attrs' => [
@@ -371,8 +373,10 @@
371 373 'max' => $trip->max_travelers ?: 20,
372 374 'data-category-label' => $category_label,
373 375 'data-price' => $category_price,
374 376 'data-pricing-mode' => $pricing_mode,
377 + 'data-group-overflow' => $pt->group_overflow ?? 'block',
378 + 'data-max-pax' => $pt->max_pax ?? '',
375 379 ],
376 380 ];
377 381 }
378 382 $traveler_display_text = !empty($traveler_rows) ? ($traveler_rows[0]['label'] . ' x ' . max(1, (int) $traveler_rows[0]['input_attrs']['value'])) : __('Traveler x 1', 'yatra');
@@ -423,10 +427,13 @@
423 427 <div class="yatra-summary-meta">
424 428 <?php
425 429 $duration_days = (int) ($trip->duration_days ?? 0);
426 430 $duration_nights = isset($trip->duration_nights) ? (int) $trip->duration_nights : null;
431 + $duration_hours = (int) ($trip->duration_hours ?? 0);
427 432 ?>
428 - <?php if ($duration_days > 0) : ?>
433 + <?php if ($duration_hours > 0) : ?>
434 + <span><?php echo esc_html(yatra_format_duration(0, null, $duration_hours)); ?></span>
435 + <?php elseif ($duration_days > 0) : ?>
429 436 <?php if ($duration_days <= 1) : ?>
430 437 <span><?php esc_html_e('Day Trip', 'yatra'); ?></span>
431 438 <?php else : ?>
432 439 <span><?php echo esc_html(yatra_format_duration($duration_days, $duration_nights)); ?></span>
@@ -660,19 +667,31 @@
660 667 $service_name = $service['name'];
661 668 $service_description = (string) ($service['description'] ?? '');
662 669 $service_price = (float) $service['price'];
663 670 $service_price_per = $service['price_per'] ?? 'person';
671 + $service_price_type = $service['price_type'] ?? 'fixed';
664 672 $is_required = isset($service['is_required']) && ($service['is_required'] === true || $service['is_required'] === 1 || $service['is_required'] === '1');
665 673 $is_included = isset($service['is_included']) && ($service['is_included'] === true || $service['is_included'] === 1 || $service['is_included'] === '1');
666 674 $is_selected = in_array($service_id, $selected_service_ids, false);
667 675
668 - $price_label = yatra_format_price($service_price);
669 - if ($service_price_per === 'person') {
670 - $price_label .= ' ' . __('per person', 'yatra');
671 - } elseif ($service_price_per === 'day') {
672 - $price_label .= ' ' . __('per day', 'yatra');
676 + // Percentage services show "X% of trip price" (the actual
677 + // dollar amount is rendered in the price-breakdown summary).
678 + // Price Per does NOT apply to percentage (it's a % of the
679 + // whole trip), so no per-person/day/booking suffix is added.
680 + // Fixed services show the formatted amount plus the suffix.
681 + if ($service_price_type === 'percentage') {
682 + $pct_display = rtrim(rtrim(number_format($service_price, 2), '0'), '.');
683 + /* translators: %s: percentage value, e.g. "17" */
684 + $price_label = sprintf(__('%s%% of trip price', 'yatra'), $pct_display);
673 685 } else {
674 - $price_label .= ' ' . __('per booking', 'yatra');
686 + $price_label = yatra_format_price($service_price);
687 + if ($service_price_per === 'person') {
688 + $price_label .= ' ' . __('per person', 'yatra');
689 + } elseif ($service_price_per === 'day') {
690 + $price_label .= ' ' . __('per day', 'yatra');
691 + } else {
692 + $price_label .= ' ' . __('per booking', 'yatra');
693 + }
675 694 }
676 695 if ($is_included) {
677 696 $price_label = __('Included', 'yatra');
678 697 }