How to get product count with respect to categories in WooComerce
Hi I want to display all the categories of products in a loop to display them in category menu along the numbers of products each category contains. Some thing like that
so far I have done this to get all categories
$args = array(
'number' = $number,
'orderby' = $orderby,
'order' = $order,
'hide_empty' = $hide_empty,
'include' = $ids
);
$product_categories = get_terms( 'product_cat', $args );
foreach( $product_categories as $cat ) { echo $cat-name; }
But I want to know how to display products numbers in each category.
Topic woocommerce-offtopic categories Wordpress
Category Web