Quantcast
Channel: WordPress.org Forums » [WooCommerce] Support
Viewing all articles
Browse latest Browse all 102159

Dcone on "[Plugin: WooCommerce - excelling eCommerce] Custom loop using multiple categories"

$
0
0

I was able to solve my problem using the following:

<?php
$args = array(
  'post_type' => 'product',
  'posts_per_page' => -1,
  'tax_query' => array(
    'relation' => 'AND',
    array(
     'taxonomy' => 'product_cat',
     'field' => 'slug',
     'terms' => $catOne
    ),
    array(
     'taxonomy' => 'product_cat',
     'field' => 'slug',
     'terms' => $catTwo
    )
  )
);
?>

Hope it helps someone else!


Viewing all articles
Browse latest Browse all 102159

Trending Articles