Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

taxonomy query

// WP_Query arguments
$args = array(
	'post_type'              => array( 'product' ),
	'tax_query'              => array(
		array(
			'taxonomy'         => 'pa_details',
			'field'            => 'name',
			'operator'         => 'IN',
			'include_children' => false,
		),
	),
);

// The Query
$alex_query = new WP_Query( $args );

// The Loop
if ( $alex_query->have_posts() ) {
	while ( $alex_query->have_posts() ) {
		$alex_query->the_post();
		// do something
	}
} else {
	// no posts found
}

// Restore original Post Data
wp_reset_postdata();