I’m currently working on shop page and custom product loop. With WP_Query I can succesfully display products based on meta_key and meta_val but i run into trouble.
Now i have to display all products from category and as argument i need to pass category_id. This is my code:
$args = array(
‘post_type’ => ‘product’,
// get category by slug is working –
‘product_cat’ => ‘products-from-cat-40’,
I know that woocommerce have slightly different query arguments than wordpress so i’ve tried so far:
As ID i passed both integer and string but still nothing works. I’ve searched trough internet for list of viable Woocommerce WP_Query arguments and i couldn’t find it. Can anyone help? I’ll much appreciate.
Read more here:: WC displaying products from category