| @@ -56,9 +56,17 @@ | ||
| 56 | 56 | data-name="<?php echo esc_attr($current_filter_name); ?>" |
| 57 | 57 | style="display:none;"></div> |
| 58 | 58 | <?php endif; ?> |
| 59 | 59 | |
| 60 | -<div class="yatra-listing-page yatra-trip-listing" id="yatra-trip-listing-root"> | |
| 60 | +<?php | |
| 61 | +// Trip-listing card layout (Settings → Design). The archive follows the | |
| 62 | +// site-wide setting; the class is placed on this container so the listing CSS | |
| 63 | +// can key off it (see assets/css/listing.css "Compact card layout"). | |
| 64 | +$yatra_listing_layout_class = \Yatra\Providers\FrontendAssetsProvider::listingLayoutClasses( | |
| 65 | + \Yatra\Providers\FrontendAssetsProvider::resolveListingLayout() | |
| 66 | +); | |
| 67 | +?> | |
| 68 | +<div class="yatra-listing-page yatra-trip-listing<?php echo $yatra_listing_layout_class ? ' ' . esc_attr($yatra_listing_layout_class) : ''; ?>" id="yatra-trip-listing-root"> | |
| 61 | 69 | <!-- Trip Search Shortcode - replaces hardcoded search UI --> |
| 62 | 70 | <div class="yatra-trip-listing-search-wrap"> |
| 63 | 71 | <?php |
| 64 | 72 | // Build the [yatra_search] arguments from the Search & Listing toggles so |
| @@ -165,11 +173,18 @@ | ||
| 165 | 173 | <!-- Price Range --> |
| 166 | 174 | <?php |
| 167 | 175 | $price_stats = $filter_data['price_stats'] ?? $tripListingService->getPriceStats(); |
| 168 | 176 | |
| 169 | - $min_price = $price_stats ? (int)$price_stats->min_price : 0; | |
| 170 | - $max_price = $price_stats ? (int)$price_stats->max_price : 10000; | |
| 171 | - $step = max(1, (int)($max_price / 100)); // Dynamic step based on price range | |
| 177 | + $min_price = $price_stats ? (int) floor($price_stats->min_price) : 0; | |
| 178 | + $max_price = $price_stats ? (int) ceil($price_stats->max_price) : 10000; | |
| 179 | + // Step 1 so the range slider can land EXACTLY on the true | |
| 180 | + // maximum price. A larger "dynamic" step (max/100) only lets | |
| 181 | + // the thumb stop on min + N*step, so unless (max - min) is a | |
| 182 | + // whole multiple of that step the slider caps short of the | |
| 183 | + // real max — e.g. min 9 / max 10000 / step 100 stops at | |
| 184 | + // 9909, hiding the most expensive trips from the filter. | |
| 185 | + // An integer step also keeps submitted price bounds whole. | |
| 186 | + $step = 1; | |
| 172 | 187 | ?> |
| 173 | 188 | <div class="yatra-filter-section"> |
| 174 | 189 | <div class="yatra-filter-title" data-toggle="price"> |
| 175 | 190 | <div class="yatra-filter-title-content"> |