Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    3
    Plugin Contributions
    0

    Default secondary sort order on product listing?

    Hey All,

    Is it possible to put a secondary sort on an item in the product listing?

    ..I'm currently sorting on manufacturer - then within each manufacturer, I need to sort on the model (or perhaps some other field). anyone know if this is possible?

    ...much thanks, monk

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: secondary sort order on product listing?

    You would need to alter the ORDER on the SELECT statement where manufacturer is used ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jan 2008
    Posts
    3
    Plugin Contributions
    0

    Default Re: secondary sort order on product listing?

    thank you Ajeh for the pointer. you put me in the correct direction.

    in case anyone else needs something like this, here's the solution i took:

    - you'll find the SQL that's used for the product listing in :
    <install path>/includes/index_filters/default_filter.php
    - there's a variety of filters (order by) sql you'll find here.. i needed a primary sort on manufacturer (which can be done via the admin : configuration->product listing->display product listing default sort) and a secondary sort on model (vs. the default secondary sort on product name).
    -- so i altered around line 122 from:
    $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    to:
    $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", p.products_model";

    ...that did the trick.

    thanks- javaMonk();

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: secondary sort order on product listing?

    Thanks for posting the solution that worked for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. Product listing sort order
    By Nordenfor in forum General Questions
    Replies: 2
    Last Post: 24 Feb 2011, 05:13 PM
  2. Product Listing numeric Sort Order
    By iivann in forum Basic Configuration
    Replies: 1
    Last Post: 10 Sep 2010, 03:29 PM
  3. Product Listing - SORT ORDER???
    By kgmmusic in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 8 Feb 2009, 12:06 PM
  4. Product Listing Descending Sort Order
    By wolf99 in forum Basic Configuration
    Replies: 3
    Last Post: 24 Feb 2007, 05:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg