Answer the question
In order to leave comments, you need to log in
Why don't filters work in woocommerce custom taxonomy?
Made a custom category in WC.
The output goes like this
woocommerce_product_loop_start();
$args = array(
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'product_cat',
'field' => 'ID',
'terms' => $term,
),
array(
'taxonomy' => $attribute,
'field' => 'ID',
'terms' => $term_2,
)
),
'posts_per_page' => 6,
'post_type' => 'product',
'orderby' => 'rand',
);
$loop = new WP_Query($args);
while ( $loop->have_posts() ) : $loop->the_post();
do_action('woocommerce_shop_loop');
wc_get_template_part('content', 'product');
endwhile;
wp_reset_query();
woocommerce_product_loop_end();
woocommerce_product_loop_start();
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) {
the_post();
/**
* Hook: woocommerce_shop_loop.
*/
do_action( 'woocommerce_shop_loop' );
wc_get_template_part( 'content', 'product' );
}
}
woocommerce_product_loop_end();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question