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:
parent
ecb672eeb5
commit
c980c67f7d
|
@ -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' );
|
||||
|
|
Loading…
Reference in New Issue