In Woocommerce Category page default sort dropdown has like below options.
My question is what/how products sort by Popularity ? Not a code What is the measurement ? like if sort Price: Low to High,then we know those product sort Low price to High then How about Popularity ?
In Woocommerce Category page default sort dropdown has like below options.
My question is what/how products sort by Popularity ? Not a code What is the measurement ? like if sort Price: Low to High,then we know those product sort Low price to High then How about Popularity ?
'Sort By Popularity' filter sort products based on total sales of product
Well the option Sort by Popularity will sort the products based on Total sales. It means the product will sort from Higher sales to Lower sales.
You can get more idea from below code :-
$args['meta_key'] = 'total_sales';
add_filter( 'posts_clauses', array( $this, 'order_by_popularity_post_clauses' ) );