I would like to consider best-selling product in this loop :
\'product\', \'posts_per_page\' => 1, \'product_
Solution 1: Add This plugin WP woocommerce best selling products by category
Solution 2: For retrieving the best buying products in WooCommerce we are using wp_query manipulation with meta_key as “total_sales” and orderby “meta_value_num”. In short we are displaying products as per the total sales number.Here is the code for this
'product',
'meta_key' => 'total_sales',
'orderby' => 'meta_value_num',
'posts_per_page' => 1,
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
global $product; ?>