From ae954f3cc5af574c8131a3262f189073aebb3548 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Tue, 10 May 2022 04:02:10 +1000 Subject: [PATCH] Store recent sales eligibility transient as string --- .../src/Internal/Admin/WcPaySubscriptionsPage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/woocommerce/src/Internal/Admin/WcPaySubscriptionsPage.php b/plugins/woocommerce/src/Internal/Admin/WcPaySubscriptionsPage.php index ca76f3754cf..e76ace21ba0 100644 --- a/plugins/woocommerce/src/Internal/Admin/WcPaySubscriptionsPage.php +++ b/plugins/woocommerce/src/Internal/Admin/WcPaySubscriptionsPage.php @@ -127,7 +127,7 @@ class WcPaySubscriptionsPage { // Valid cache found. if ( false !== $is_eligible ) { - return $is_eligible; + return 'eligible' === $is_eligible; } // Get a single order that was marked as completed within the last 30 days. @@ -139,10 +139,10 @@ class WcPaySubscriptionsPage { ) ); - $is_eligible = count( $orders ) >= 1; + $is_eligible = count( $orders ) >= 1 ? 'eligible' : 'not_eligible'; set_transient( $transient_key, $is_eligible, DAY_IN_SECONDS ); - return $is_eligible; + return 'eligible' === $is_eligible; } /**