WordPress Custom Query String

I am using WPBakery Page Builder (Previously Visual Composer), WordPress 4.9 and Woocommerce 3.2.5.

I want to use a Custom Query to list All Products which belongs to a category with slug ‘my-category’ and have stock.

I have build the following query string but it is showing all products:

post_type=product
&tax_query[relation]=and
&tax_query[0][taxonomy]=product_cat
&tax_query[0][field]=slug
&tax_query[0][terms]=my-category
&tax_query[0][operator]=IN
&meta_query[0][key]=_stock_status
&meta_query[0][value]=instock

Not sure what I am missing, any ideas?

Read more here:: WordPress Custom Query String

Leave a Reply

Your email address will not be published. Required fields are marked *