$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>categories - Woocommerce Category Sort Dropdown|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

categories - Woocommerce Category Sort Dropdown

matteradmin8PV0评论

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 ?

Share Improve this question asked Nov 16, 2018 at 6:09 RikaRika 1131 silver badge6 bronze badges 2
  • popularity — you can choose this option if you want products to be sorted from most popular to the least popular ones; – vikrant zilpe Commented Nov 16, 2018 at 6:37
  • please check this link code:github/woocommerce/woocommerce/blob/… – vikrant zilpe Commented Nov 16, 2018 at 6:39
Add a comment  | 

2 Answers 2

Reset to default 0

'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' ) );

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far