0

i have this function to order for category the shop page in woocomerce

function so_27975262_product_query( $q ){ 
//$q->set( 'category__in', array(96,105,97) ); 
if( !is_product_category() ) { 
    $q->set( 'tax_query', array ( array( 'taxonomy' => 'product_cat', 'field' => 'term_id', 'terms' => array(96,106,111,116,108,103), ) ));
 }
}
add_action( 'woocommerce_product_query', 'so_27975262_product_query' );

this works but i have a problem

the ordering follow the id...

exemple i want this order 96,106,111,116,108,103 but the order that i receive are

96,103,106,108,111,116

these are the parent category obviously

who help me ? thanks a lot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.