Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Nov 2010
    Posts
    58
    Plugin Contributions
    0

    Default How to set the products to sort by date added?

    Hi, currently all my products listing are listing alphabetically.
    How can I set it to date added? As in new items on top. Old items below.

    I have set the config-> all listing Display Product Display - Default Sort Order-> 6

    6= Date Added desc

    However, nothing changes.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,666
    Plugin Contributions
    6

    Default Re: How to set the products to date added?

    Each of the Product Listings has its own settings ...

    You will need to edit each one to customize them to be sorted by date ...

    All Listings is the actually Listing for All of your Products when you click on the link for All Products ...

    There are settings for:
    Product Info
    Product Listing
    New Products
    Featured Listing
    All Listing

    about the only one that would give a problem is the Product Listing as that does not have a sort order by date ...

    For that, you would need to customize the code ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Nov 2010
    Posts
    58
    Plugin Contributions
    0

    Default Re: How to set the products to date added?

    I've already listed all my products up. How do I customize the code? Or I have to individually go into every product to set it to be sorted by date?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,666
    Plugin Contributions
    6

    Default Re: How to set the products to date added?

    You could set the Product Listing to blank on the sort order, meaning nothing ... then customize the code:
    /includes/index_filters/default_filter.php

    and change the code from:
    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;
    to read:
    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";
    // bof: customize to sort by date descending
              $listing_sql .= " order by p.products_date_added desc, p.products_sort_order, pd.products_name";
    // eof: customize to sort by date descending
              break;
    Now, when navigating the Categories the listing will be by date, sort order, name ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Nov 2010
    Posts
    58
    Plugin Contributions
    0

    Default Re: How to set the products to date added?

    Awesome! Thanks!

  6. #6
    Join Date
    May 2008
    Posts
    354
    Plugin Contributions
    0

    Default Re: How to set the products to date added?

    Hi, i have Product Listing Grid mod installed i tried the aboe and it dont seem to be working, does something different need to be done because of the installed mod?

    Hope you can help.

    Thanks

  7. #7
    Join Date
    Jan 2009
    Location
    Queensland, Australia
    Posts
    117
    Plugin Contributions
    0

    Default Re: How to set the products to date added?

    This has also helped me. thanks so much

  8. #8
    Join Date
    Mar 2011
    Posts
    13
    Plugin Contributions
    0

    Default Re: How to set the products to date added?

    we are using 1.3.9h version of zen. We have changed the code as per the instructions below, and still get nothing. All Alpha still. is it necessary to reset our other listings so that they should read something other than a 6. The product Listing is left blank on the sort order.

    Quote Originally Posted by Ajeh View Post
    You could set the Product Listing to blank on the sort order, meaning nothing ... then customize the code:
    /includes/index_filters/default_filter.php

    and change the code from:
    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;
    to read:
    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";
    // bof: customize to sort by date descending
              $listing_sql .= " order by p.products_date_added desc, p.products_sort_order, pd.products_name";
    // eof: customize to sort by date descending
              break;
    Now, when navigating the Categories the listing will be by date, sort order, name ...

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,666
    Plugin Contributions
    6

    Default Re: How to set the products to sort by date added?

    If you click on the Product Name sorter for the listing, what comes up on URL for the
    sort=

    and does it sort right when you have it in ascending order?
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  10. #10
    Join Date
    Feb 2012
    Posts
    78
    Plugin Contributions
    0

    Default Re: How to set the products to sort by date added?

    I tried this and it sorts my items correctly as by date added, however, the next and previous button need tinkering.

    if i clicked on the first item (the newest added) the order of the product is the last item (ie 51/51) this makes the next button go to 1/51.

    I tried a few things but to no avail.

    I have the listing order using the modification from above. http://sales.michaelhulak.com/index....=index&cPath=1
    Last edited by Ajeh; 5 Mar 2012 at 03:17 AM. Reason: remove zenid never post those

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. sort sub-category view by date added
    By hpowers in forum Setting Up Categories, Products, Attributes
    Replies: 14
    Last Post: 17 Nov 2011, 09:35 AM
  2. sort by price, date added, etc
    By RollzRoyce in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 5 Aug 2010, 05:03 PM
  3. Sort by Date Added New to Old (etc) on Product Listing Pages?
    By limelites in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 25 May 2009, 09:21 PM
  4. Sort by Date Added/Product ID
    By edadk in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 10 Nov 2008, 04:56 PM
  5. Sort By Date Added!!
    By brotherhud in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 21 Feb 2007, 01:39 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
  •