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); echo "
"; foreach ($topLevelCats as $cat) { echo "
".site()->render("page-tile", $cat)."
"; } echo "
"; // var_dump($topLevelCats); } }