The order of slicing then reversing of both the top sellers and top earners arrays meant that the bottom 25 products were displayed, not the top 25.

The first asort puts the values in ascending order so slicing first takes the bottom values upwards.

By reversing first then slicing we get the top 25 downwards.
This commit is contained in:
John Cotton 2011-11-24 00:55:29 +00:00
parent ecb672eeb5
commit c980c67f7d
1 changed files with 1 additions and 1 deletions

View File

@ -887,8 +887,8 @@ function woocommerce_top_sellers() {
endif;
asort($found_products);
$found_products = array_slice($found_products, 0, 25, true);
$found_products = array_reverse($found_products, true);
$found_products = array_slice($found_products, 0, 25, true);
reset($found_products);
remove_filter( 'posts_where', 'orders_within_range' );