From e772e86221c68caa4913317242279258ccea7c18 Mon Sep 17 00:00:00 2001 From: Kurtis Holsapple Date: Fri, 18 Jul 2025 16:19:15 -0700 Subject: [PATCH] changes --- actions/ShopPageShowCatsInsteadAction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/ShopPageShowCatsInsteadAction.php b/actions/ShopPageShowCatsInsteadAction.php index 7846f3e..b0c4805 100644 --- a/actions/ShopPageShowCatsInsteadAction.php +++ b/actions/ShopPageShowCatsInsteadAction.php @@ -34,10 +34,10 @@ 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); - $productCats = site()->getTerm('product_cat', ['url', 'thumbnail', 'title', 'count']); + $productCats = site()->getTerm('product_cat', ['url', 'thumbnail', 'title', 'count', 'parent']); $withoutUncategorized = array_filter($productCats, fn ($c) => !str_contains($c["url"], "uncategorized")); - $topLevelCats = array_filter($withoutUncategorized, fn ($c) => $c->parent == 0); + $topLevelCats = array_filter($withoutUncategorized, fn ($c) => $c["parent"] == 0); echo "
"; foreach ($topLevelCats as $cat) {