Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Sort By Bestselling Rate Topic   - - - - -

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 822 posts

Posted 13 June 2019 - 08:55 PM #1

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.


CS-Cart Ultimate ver 4.9.3 SP1


 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 915 posts

Posted 13 June 2019 - 09:40 PM #2

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

Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19845 posts

Posted 14 June 2019 - 05:38 AM #3

Popularity is not bestsellers. So the correct code will be

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

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 822 posts

Posted 14 June 2019 - 02:25 PM #4

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

CS-Cart Ultimate ver 4.9.3 SP1


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19845 posts

Posted 17 June 2019 - 05:19 AM #5

 

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.