global $product;
$cats = wc_get_product_terms( $product->id, \'product_cat\', array( \'fields\' => \'slugs\' ) );
$brands = wc_get_product_terms( $product->id, \'pa_brand\', array( \'fields\' => \'slugs\' ) );
$artists = wc_get_product_terms( $product->id, \'pa_artist\', array( \'fields\' => \'slugs\' ) );
$manufacturers = wc_get_product_terms( $product->id, \'pa_manufacturer\', array( \'fields\' => \'slugs\' ) );
unset( $args[\'post__in\'] );
$args[\'tax_query\'] = array(
\'relation\' => \'AND\',
array(
\'taxonomy\' => \'product_cat\',
\'field\' => \'slug\',
\'terms\' => $cats,
),
array(
\'relation\' => \'OR\',
array(
\'taxonomy\' => \'pa_brand\',
\'field\' => \'slug\',
\'terms\' => $brands,
),
array(
\'taxonomy\' => \'pa_artist\',
\'field\' => \'slug\',
\'terms\' => $artists,
),
array(
\'taxonomy\' => \'pa_manufacturer\',
\'field\' => \'slug\',
\'terms\' => $manufacturers,
)
)
);
return $args;