From 40be3bb1c3b91aec3f7411aa5ebb43fd6b2a6d14 Mon Sep 17 00:00:00 2001 From: Kurtis Holsapple Date: Fri, 18 Jul 2025 16:14:49 -0700 Subject: [PATCH] changes --- actions/DontShowProductsOnShopLandingPageAction.php | 12 +----------- actions/WooCommerceCategoryLayoutHideProducts.php | 2 +- tpl/hideProductsWrapper.tpl | 6 ++++++ tpl/{hideProducts.tpl => hideWooCommerceWrapper.tpl} | 0 4 files changed, 8 insertions(+), 12 deletions(-) create mode 100644 tpl/hideProductsWrapper.tpl rename tpl/{hideProducts.tpl => hideWooCommerceWrapper.tpl} (100%) diff --git a/actions/DontShowProductsOnShopLandingPageAction.php b/actions/DontShowProductsOnShopLandingPageAction.php index 5c8a394..50b5631 100644 --- a/actions/DontShowProductsOnShopLandingPageAction.php +++ b/actions/DontShowProductsOnShopLandingPageAction.php @@ -25,16 +25,6 @@ class DontShowProductsOnShopLandingPageAction extends RadAction return; } - remove_all_actions('woocommerce_before_shop_loop'); - remove_all_actions('woocommerce_shop_loop'); - remove_all_actions('woocommerce_after_shop_loop'); - remove_all_actions('woocommerce_no_products_found'); - - add_action('pre_get_posts', function ($query) { - if (!is_admin() && $query->is_main_query()) { - $query->set('post_type', 'product'); - $query->set('posts_per_page', 0); - } - }, 99); + echo site()->render("hideProductsWrapper"); } } diff --git a/actions/WooCommerceCategoryLayoutHideProducts.php b/actions/WooCommerceCategoryLayoutHideProducts.php index f92060a..e0099cd 100644 --- a/actions/WooCommerceCategoryLayoutHideProducts.php +++ b/actions/WooCommerceCategoryLayoutHideProducts.php @@ -25,6 +25,6 @@ class WooCommerceCategoryLayoutHideProducts extends RadAction return; } - echo site()->render("hideProducts"); + echo site()->render("hideWooCommerceWrapper"); } } diff --git a/tpl/hideProductsWrapper.tpl b/tpl/hideProductsWrapper.tpl new file mode 100644 index 0000000..c3a6860 --- /dev/null +++ b/tpl/hideProductsWrapper.tpl @@ -0,0 +1,6 @@ + diff --git a/tpl/hideProducts.tpl b/tpl/hideWooCommerceWrapper.tpl similarity index 100% rename from tpl/hideProducts.tpl rename to tpl/hideWooCommerceWrapper.tpl