From ea5a03db02b642d26b66d96c0af84a80787efdbd Mon Sep 17 00:00:00 2001 From: Kurtis Holsapple Date: Fri, 18 Jul 2025 15:42:57 -0700 Subject: [PATCH] changes --- actions/ShopPageShowCatsInsteadAction.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actions/ShopPageShowCatsInsteadAction.php b/actions/ShopPageShowCatsInsteadAction.php index bab93cd..f1b15ab 100644 --- a/actions/ShopPageShowCatsInsteadAction.php +++ b/actions/ShopPageShowCatsInsteadAction.php @@ -34,7 +34,8 @@ class ShopPageShowCatsInsteadAction extends RadAction remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5); remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); - $topLevelCats = site()->getTerm('product_cat'); + $productCats = site()->getTerm('product_cat'); + $topLevelCats = array_filter($productCats, fn ($c) => $c->parent == 0); var_dump($topLevelCats); } }