Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2009
    Posts
    298
    Plugin Contributions
    0

    Default Product Sort Order Within A Category

    Hi,

    I have read the Zen Cart info on default product sorting and have successfully implemented this on the New Product and All Products but cannot get this to work on the Product Listing.

    I am looking to sort products by their date added, descending. As this is not an option in the Config-> Product Listing I am using the product model and have changed it from 0 to 6. When I then go to Display Product Listing Default Sort Order and set it to 6d, the sort order still stays as alphabetical, which it is now.

    I am obviously missing something....can someone point me in the right direction??

    Thank you in advance for your help.

  2. #2
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,239
    Plugin Contributions
    1

    Default Re: Product Sort Order Within A Category

    This is how I do it,

    includes/index_filters/default_filter.php

    find the 2nd instance of
    Code:
    $listing_sql .= " ORDER BY p.products_sort_order, pd.products_name";
    change to
    Code:
    $listing_sql .= " ORDER BY p.products_date_added desc, p.products_sort_order, pd.products_name";
    I believe that the setting
    Admin > configuration > product listing > Display Product Listing Default Sort Order
    needs to be left blank for this to work.
    Simon

  3. #3
    Join Date
    Oct 2009
    Posts
    298
    Plugin Contributions
    0

    Default Re: Product Sort Order Within A Category

    Hi Simon,

    Thanks for your help and reply! I'll give this a go later today and will let you know.

    Thanks again!

  4. #4
    Join Date
    Oct 2009
    Posts
    298
    Plugin Contributions
    0

    Default Re: Product Sort Order Within A Category

    Hi again Simon....your code change worked perfectly and I now have the products in each category being sorted by date added.

    Thanks very much for your help!

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,239
    Plugin Contributions
    1

    Default Re: Product Sort Order Within A Category

    Quote Originally Posted by NWCE View Post
    Hi again Simon....your code change worked perfectly and I now have the products in each category being sorted by date added.

    Thanks very much for your help!
    Glad to help.
    Simon

 

 

Similar Threads

  1. v155 How to sort product listings within a category
    By Feznizzle in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 4 Nov 2017, 05:59 PM
  2. v151 Product Sort within Category - having problems changing the default sort order
    By Don Wagner in forum Customization from the Admin
    Replies: 4
    Last Post: 21 Oct 2012, 03:03 AM
  3. Sort Order products by price within category
    By manage-it in forum General Questions
    Replies: 0
    Last Post: 22 May 2006, 02:52 PM

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