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 | app/Shortcodes/DiscountAndDealsShortcode.php +14 -24 3.0.2.8 → 3.0.16 View file →
@@ -26,9 +26,13 @@
26 26 'show_percentage' => 'yes',
27 27 'show_time_left' => 'yes',
28 28 'show_pagination' => 'yes',
29 29 'show_filters' => 'no',
30 - 'title' => 'Special Deals & Discounts'
30 + 'title' => 'Special Deals & Discounts',
31 + // Per-instance card layout override. 'inherit' (default) = use the
32 + // site-wide Settings → Design "Listing Card Layout".
33 + // Also accepts: standard | compact_mobile | compact_all.
34 + 'card_layout' => 'inherit'
31 35 ]);
32 36 }
33 37
34 38 /**
@@ -62,14 +66,15 @@
62 66 'total_found' => $trips_data['total_found'] ?? 0,
63 67 'per_page' => $per_page
64 68 ];
65 69
66 - // Enqueue same CSS and JS as regular trip shortcode
70 + $tripShortcodeCssPath = YATRA_PLUGIN_PATH . 'assets/css/shortcodes/trip-shortcode.css';
71 + $tripShortcodeCssVer = is_readable($tripShortcodeCssPath) ? YATRA_VERSION . '.' . filemtime($tripShortcodeCssPath) : YATRA_VERSION;
67 72 wp_enqueue_style(
68 73 'yatra-trip-shortcode',
69 74 YATRA_PLUGIN_URL . 'assets/css/shortcodes/trip-shortcode.css',
70 - [],
71 - YATRA_VERSION
75 + \Yatra\Providers\FrontendAssetsProvider::shortcodeStyleDependencies(),
76 + $tripShortcodeCssVer
72 77 );
73 78
74 79 wp_enqueue_script(
75 80 'yatra-trip-shortcode',
@@ -108,13 +113,9 @@
108 113 (discounted_price > 0) OR
109 114 (sale_price > 0)
110 115 )";
111 116
112 - // Debug: Log the query
113 - if (defined('WP_DEBUG') && WP_DEBUG) {
114 - error_log('DISCOUNT QUERY: ' . $query);
115 - error_log('DISCOUNT ATTRS: ' . print_r($atts, true));
116 - }
117 +
117 118
118 119 // Add category filter if specified
119 120 if (!empty($atts['category'])) {
120 121 $tripClassificationsTable = \Yatra\Database\Tables\TripClassificationsTable::getTableName();
@@ -157,18 +158,12 @@
157 158 }
158 159
159 160 // Debug: Log the results
160 161 if (defined('WP_DEBUG') && WP_DEBUG) {
161 - error_log('DISCOUNT RESULTS COUNT: ' . count($trips));
162 +
162 163 if (!empty($trips)) {
163 164 foreach ($trips as $trip) {
164 - error_log('DISCOUNT TRIP: ' . print_r([
165 - 'id' => $trip->id,
166 - 'title' => $trip->title,
167 - 'original_price' => $trip->original_price,
168 - 'discounted_price' => $trip->discounted_price,
169 - 'sale_price' => $trip->sale_price
170 - ], true));
165 +
171 166 }
172 167 }
173 168 }
174 169
@@ -182,17 +177,12 @@
182 177 }
183 178
184 179 // Debug: Log processed trips
185 180 if (defined('WP_DEBUG') && WP_DEBUG) {
186 - error_log('PROCESSED DISCOUNT TRIPS COUNT: ' . count($processed_trips));
181 +
187 182 if (!empty($processed_trips)) {
188 183 foreach ($processed_trips as $trip) {
189 - error_log('PROCESSED TRIP: ' . print_r([
190 - 'id' => $trip->id,
191 - 'title' => $trip->title,
192 - 'has_discount' => $trip->has_discount,
193 - 'best_discount' => $trip->best_discount
194 - ], true));
184 +
195 185 }
196 186 }
197 187 }
198 188