I’m using a custom loop to display woocommerce products on a page, I need order it by range price and products ids like below :
$args = array(
'post_type' => 'product',
'orderby' => 'ID',
'order' => 'desc',
'meta_query' => array( 'relation ' => 'AND',
array(
'key' => '_price',
'value' => array( $minPrice, $maxPrice ),
'type' => 'numeric',
'compare' => 'BETWEEN',
'order' => 'asc')
)
);
Could someone help me? Thanks in advance