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/Services/ShortCodeParser/Parsers/OrderParser.php +31 -0 1.6.6 → 1.7.0 View file →
@@ -55,8 +55,9 @@
55 55 // ];
56 56
57 57 protected array $methodMap = [
58 58 'item_count' => 'getItemCount',
59 + 'review_url' => 'getReviewUrl',
59 60 'is_digital' => 'getIsDigital',
60 61 'store_vat_display' => 'getStoreVatDisplay',
61 62 'store_company_name' => 'getStoreCompanyName',
62 63 'store_company_display' => 'getStoreCompanyDisplay',
@@ -358,8 +359,38 @@
358 359
359 360 $orderLink = TemplateService::getCustomerProfileUrl('order/' . Arr::get($this->order, 'uuid'));
360 361
361 362 return is_user_logged_in() ? $orderLink : wp_login_url($orderLink);
363 + }
364 +
365 + /**
366 + * The public "review your order" page for this order.
367 + *
368 + * Carries the order uuid, which is what lets the link work for a
369 + * guest-checkout buyer with no account to sign into — so, unlike
370 + * getCustomerOrderLink(), it is never wrapped in wp_login_url().
371 + *
372 + * Drop {{order.review_url}} into any order email template to invite a
373 + * review. Best paired with a notification that fires after fulfilment;
374 + * the page only resolves once the order has actually completed.
375 + */
376 + public function getReviewUrl($accessor = null, $code = null)
377 + {
378 + $orderHash = (string) Arr::get($this->order, 'uuid', '');
379 +
380 + if ($orderHash !== '') {
381 + return Order::reviewUrlForHash($orderHash);
382 + }
383 +
384 + $orderId = Arr::get($this->order, 'id');
385 +
386 + if (empty($orderId)) {
387 + return $code;
388 + }
389 +
390 + $order = Order::query()->find($orderId);
391 +
392 + return $order instanceof Order ? $order->getOrderReviewUrl() : $code;
362 393 }
363 394
364 395 public function getPaymentLink($accessor = null, $code = null)
365 396 {