Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Location
    West of Ireland
    Posts
    174
    Plugin Contributions
    0

    Default Product Listing Descending Sort Order

    I noticed a few threads that touched on this subject but none that I could properly understand that directly dealt with it, so here goes.

    I have my products loaded (v1.3.5) with sort order given as loading 10,20,30,...etc.
    Now realise that when updates come in, they will be placed at the back of old products, basically, how can I make all my normal product listings sort into reverse sort order? (i.e. 610, then 600, then 590 etc.)

    I guess It would also work if I was able to make the listings sort by added date, with most recent showing first

    anyone able to tell me how to do this??

    thanks

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

    Default Re: Product Listing Descending Sort Order

    To reverse it ... you would need to leave the setting blank and then customize the code in the:
    /includes/index_filters/default_filter.php

    There is a section that sets the blank which is converted to 20a to:
    PHP Code:
    // sort by products_sort_order when PRODUCT_LISTING_DEFAULT_SORT_ORDER is left blank
    // for reverse, descending order use:
    //       $listing_sql .= " order by p.products_sort_order desc, pd.products_name";
              
    $listing_sql .= " order by p.products_sort_order, pd.products_name";
              break; 
    Switch the commented line so you are using the desc ...

    NOTE: There is not an override for this file ...

    You will need to decide if there is a benefit to this on searches ...
    /includes/modules/pages/advanced_search_result/header_php.php

    This is the code:
    PHP Code:
        } else {
          
    // sort by products_sort_order when PRODUCT_LISTING_DEFAULT_SORT_ORDER ia left blank
          // for reverse, descending order use:
          //       $listing_sql .= " order by p.products_sort_order desc, pd.products_name";
          
    $order_str .= " order by p.products_sort_order, pd.products_name";
          break; 
    Note the $listing_sql needs to be changed to $order_str if you make the change here ...
    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: v1.5.5]
    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
    Sep 2006
    Location
    West of Ireland
    Posts
    174
    Plugin Contributions
    0

    Default Re: Product Listing Descending Sort Order

    Thanks Ajeh, works a treat

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

    Default Re: Product Listing Descending Sort Order

    You are most welcome ... glad that this 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: v1.5.5]
    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 - SORT ORDER???
    By kgmmusic in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 8 Feb 2009, 12:06 PM
  3. secondary sort order on product listing?
    By javamonk in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 29 Jan 2008, 06:56 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR