i have a woocomemce site and the products have a "manufacturer" attribute.
when i get the terms for a single product :
$terms= get_the_terms($product->id,"pa_manufacturer");
i get :
Array ( [230] => stdClass Object ( [term_id] => 230 [name] => Dadawan [slug] => dadawan [term_group] => 0 [term_taxonomy_id] => 230 [taxonomy] => pa_manufacturer [description] => [parent] => 0 [count] => 4 [object_id] => 2905 ) )
Can i do a loop WP_query only with that term_id to get products with the same manufacturer? How can i get only the products with that specific term_id?
here is my test, but not working...
$args = array(
'post_type' => 'product',
'term_id' => 230 ,
'posts_per_page' => 2,
'orderby' => $orderby
);
$loop = new WP_Query( $args );
// Do stuff here to display your products
Any help appreciated, thanks.