i have a wordpress site that uses woocommerce as an online shop plugin. what is want is listing all products in my woocommerce site grouped by their categories, how can i do this? i want the list sorted ASC and i want all empty categories hidden! thanks in advanced!

closed as off-topic by kaiser Sep 2 '14 at 17:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.


i think this is what you need:

$args = array(
'orderby'    => 'name',
'hide_empty' => 1
$category_terms = get_terms( 'product_cat', $args );

foreach($category_terms as $cat_term){

echo $cat_term->name;

btw: woocommerce is offtopic here!

Not the answer you're looking for? Browse other questions tagged or ask your own question.