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