From 73633ee3d1d07de93edd4a3a401508b95439ec67 Mon Sep 17 00:00:00 2001 From: Paulo Arromba <17236129+wavvves@users.noreply.github.com> Date: Wed, 26 Jul 2023 13:25:49 +0300 Subject: [PATCH] Render Checkout/Cart containing pages without template overriding (https://github.com/woocommerce/woocommerce-blocks/pull/10359) * Render Checkout/Cart containing pages without template overriding * Fix checkout typo --------- Co-authored-by: Mike Jolley --- plugins/woocommerce-blocks/src/Templates/CartTemplate.php | 3 ++- plugins/woocommerce-blocks/src/Templates/CheckoutTemplate.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-blocks/src/Templates/CartTemplate.php b/plugins/woocommerce-blocks/src/Templates/CartTemplate.php index 06e340bef01..03ea68ecab0 100644 --- a/plugins/woocommerce-blocks/src/Templates/CartTemplate.php +++ b/plugins/woocommerce-blocks/src/Templates/CartTemplate.php @@ -32,7 +32,8 @@ class CartTemplate extends AbstractPageTemplate { * @return boolean */ protected function is_active_template() { - return is_cart(); + global $post; + return get_option( 'woocommerce_cart_page_endpoint' ) === $post->post_name; } /** diff --git a/plugins/woocommerce-blocks/src/Templates/CheckoutTemplate.php b/plugins/woocommerce-blocks/src/Templates/CheckoutTemplate.php index 982163e97d0..399580012c9 100644 --- a/plugins/woocommerce-blocks/src/Templates/CheckoutTemplate.php +++ b/plugins/woocommerce-blocks/src/Templates/CheckoutTemplate.php @@ -41,6 +41,7 @@ class CheckoutTemplate extends AbstractPageTemplate { * @return boolean */ public function is_active_template() { - return is_checkout(); + global $post; + return get_option( 'woocommerce_checkout_page_endpoint' ) === $post->post_name; } }