Sort By Bestselling

I have a page that displays BestSellers using:

"/index.php?dispatch=products.bestsellers"

Currently the Bestsellers page includes 149 products (selected by script, not admin defined).

Is there any way to change the sort order ON THAT PAGE ONLY so it's not sorted by the default sort order, but instead sorted by "Bestselling"?

There is no way to change the sort order for a product list other than to set a default value for the entire site.

If I could make just the BestSellers page sort by "Bestselling" then the ACTUAL bestselling products would be at the top of the list and begin descending by their sales volume - which is what one expects to happen when you click a BestSellers link.

I'm open to writing modifications to the script but can't seem to riddle out where I add the code.

Hello

You can sort by popularity without major changes. See the file /app/addons/bestsellers/controllers/frontend/products.post.php
and add the line
$params ['sort_by'] = "popularity";
after the line $title = __ ("bestsellers");
I did not test it
Best regards
Robert

Popularity is not bestsellers. So the correct code will be

$params ['sort_by'] = "bestsellers";
$params ['sort_order'] = "desc";

(!) Not tested

Thank you gentlemen.

The solutions provided worked.

File: /app/addons/bestsellers/controllers/frontend/products.post.php
After the line $title = __ ("bestsellers");
Add the line:
$params ['sort_by'] = "bestsellers";
(do not include "$params ['sort_by'] = "desc";")

Thank you gentlemen.

The solutions provided worked.

File: /app/addons/bestsellers/controllers/frontend/products.post.php
After the line $title = __ ("bestsellers");
Add the line:
$params ['sort_by'] = "bestsellers";
(do not include "$params ['sort_by'] = "desc";")

I have corrected the code. The second parameter should be called sort_order instead of sort_by

This is a great little hack. I've changed it slightly to work on my On Sale page with the following code:

elseif ($mode == 'on_sale') {
        $title = __('on_sale');
        $params['on_sale'] = true;
$params ['sort_by'] = "popularity";
    $params ['sort_order'] = "desc";

}

Although this displays how i want if i select a different sort option from the dropdown e.g. Sort Alphabetically the products aren't resorted.

Do you know why this might be?

I've tried the original code on the Bestsellers page and the same behavior happens.