$query error in popular products function


I’ve been pulling my hair out trying to figure out why my popular products were not displaying total sales count descending. It seemed to be somewhat random.

I found this code in template_functions.php => mp_popular_products:

The custom query has this parameter to order the display of popular products: &orderby=meta_value, where mp_sales_count => meta_value.

After researching the wp codex I found this: https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters

I changed order by to &orderby=meta_value_num

My popular products are now properly displaying most sales descending.

Is there another cause for this display order issue?

Thought I would pass it on for explanation and possible fix in a future release.

Merv (lzw8bk)