PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 All 50 releases
← All changes | app/Http/Routes/WebRoutes.php +33 -1 1.6.6 → 1.7.0 View file →
@@ -23,8 +23,9 @@
23 23 use FluentCart\App\Vite;
24 24 use FluentCart\Framework\Support\Arr;
25 25 use FluentCart\App\Services\Renderer\CheckoutRenderer;
26 26 use FluentCart\App\Services\Renderer\ModalCheckoutRenderer;
27 +use FluentCart\App\Services\Renderer\OrderReviewRenderer;
27 28
28 29 class WebRoutes
29 30 {
30 31 public static function register()
@@ -282,9 +283,40 @@
282 283 'wp_head' => false,
283 284 'wp_footer' => false,
284 285 ]);
285 286 return true;
286 -
287 +
288 + case 'order-review':
289 + ob_start();
290 + $orderFound = (new OrderReviewRenderer(
291 + sanitize_text_field($request->get('order_hash', ''))
292 + ))->render();
293 + $orderReview = ob_get_clean();
294 +
295 + // A bad or stale link is a page that does not exist, and
296 + // says so to crawlers as well as people.
297 + if (!$orderFound) {
298 + status_header(404);
299 + }
300 +
301 + // wp_head/wp_footer left on, unlike the receipt: the review
302 + // form's script and stylesheet are enqueued during render()
303 + // and there is nowhere else for them to print. It also lets
304 + // the theme dress a page the customer reaches from an email.
305 + // wp_head/wp_footer forced on. This route renders the whole
306 + // document, so nothing else prints them — and the view's
307 + // is_page() guard would otherwise skip both on a site whose
308 + // front page is static, silently dropping every asset the
309 + // review form (and Pro's photo fields) enqueued.
310 + FrontendView::make(
311 + __('Review Your Order', 'fluent-cart'),
312 + $orderReview,
313 + [
314 + 'wp_head' => true,
315 + 'wp_footer' => true,
316 + ]
317 + );
318 + return true;
287 319
288 320 case 'print-invoice':
289 321 return self::handlePrintRoute('invoice');
290 322