I have a custom product type and custom loop for listing woocommerce products
$query_args = array(
'post_type' => 'product',
'tax_query' => array(
array(
'taxonomy' => 'product_type',
'field' => 'slug',
'terms' => 'custom_type',
),
),
);
$r = new WP_Query( $query_args );
if ( $r->have_posts() ) {
I have custom data attributes in product datas. How can I use them in loop? How can I filter products with this attributes?
For example I have color and size data attributes. Now how can I the list red and large products?