Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Mar 2009
    Location
    Crockett, Texas
    Posts
    139
    Plugin Contributions
    0

    Default How to make new products show first on categories and sub categories...HELP!

    On my site: http://www.allclipart.info, I want all of my products in the categories and sub categories to show new products first. So for example, if
    you look at my EXCLUSIVE category (http://allclipart.info/shop/index.ph...ndex&cPath=195) it shows everything in alphabetical order. I want it to show the most recently added products first.

    My "New Products, All Products, Featured Products" show in the proper order, but I can't seem to get the other categories & sub categories to show new
    products first. Can someone point me in the right direction?

    Thanks...

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

    Default Re: How to make new products show first on categories and sub categories...HELP!

    You can customize the file:
    /includes/index_filters/default_filter.php

    and add the code in RED:
    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";
              $listing_sql .= " order by p.products_date_added DESC, p.products_sort_order, pd.products_name";
              break;
    Then set the Sort Order in the Configuration ... Product Listing ... to blank for:
    Display Product Listing Default Sort Order
    Product Listing Default sort order?
    NOTE: Leave Blank for Product Sort Order. Sort the Product Listing in the order you wish for the default display to start in to get the sort order setting. Example: 2a
    And now your Categories Product Listings will default to be based on the Date Added, Sort Order, Product 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.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
    Mar 2009
    Location
    Crockett, Texas
    Posts
    139
    Plugin Contributions
    0

    Default Re: How to make new products show first on categories and sub categories...HELP!

    BEAUTIFUL!!! Worked like a dream. Thanks so much! :)

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

    Default Re: How to make new products show first on categories and sub categories...HELP!

    Thanks for the update that this was able to work 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!

  5. #5
    Join Date
    Mar 2009
    Location
    Crockett, Texas
    Posts
    139
    Plugin Contributions
    0

    Default Re: How to make new products show first on categories and sub categories...HELP!

    Hi Linda...I recently installed some modules to my site and it messed up my sort order. Anyway, I went back and did what you say in the post above and I get this message:

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by p.products_date_added DESC, p.products_sort_order, pd.products_name' at line 7
    in:

    When I visit the front end of my store. Any idea why i might be getting that? Thanks.

    BTW: When I remove the code in red it goes away.

  6. #6
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: How to make new products show first on categories and sub categories...HELP!

    Quote Originally Posted by amandavz View Post
    Hi Linda...I recently installed some modules to my site and it messed up my sort order. Anyway, I went back and did what you say in the post above and I get this message:

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by p.products_date_added DESC, p.products_sort_order, pd.products_name' at line 7
    in:

    When I visit the front end of my store. Any idea why i might be getting that? Thanks.

    BTW: When I remove the code in red it goes away.
    Please post the block of code as modified by you (file includes/index_filters/default_filter.php)

  7. #7
    Join Date
    Mar 2009
    Location
    Crockett, Texas
    Posts
    139
    Plugin Contributions
    0

    Default Re: How to make new products show first on categories and sub categories...HELP!

    and add the code in RED:

    // 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";
    $listing_sql .= " order by p.products_date_added DESC, p.products_sort_order, pd.products_name";
    break;

  8. #8
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: How to make new products show first on categories and sub categories...HELP!

    What else does the error message say after this

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by p.products_date_added DESC, p.products_sort_order, pd.products_name' at line 7
    in:
    in: what???

  9. #9
    Join Date
    Mar 2009
    Location
    Crockett, Texas
    Posts
    139
    Plugin Contributions
    0

    Default Re: How to make new products show first on categories and sub categories...HELP!

    Sorry...here is the whole error message:

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by p.products_date_added DESC, p.products_sort_order, pd.products_name' at line 7
    in:
    [select m.manufacturers_name, p.products_image, pd.products_name, p.products_quantity, p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status from zen_products_description pd, zen_products p left join zen_manufacturers m on p.manufacturers_id = m.manufacturers_id, zen_products_to_categories p2c left join zen_specials s on p2c.products_id = s.products_id where p.products_status = 1 and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '5' and p2c.categories_id = '195' order by p.products_sort_order, pd.products_name order by p.products_date_added DESC, p.products_sort_order, pd.products_name]

    Does it help to know that i just installed CEON Uri? It may have something to do with the products now being named link instead of code.

  10. #10
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: How to make new products show first on categories and sub categories...HELP!

    Quote Originally Posted by amandavz View Post
    order by p.products_sort_order, pd.products_name order by p.products_date_added DESC, p.products_sort_order, pd.products_name]
    It appears you didn't comment out the original "order by" details as you have it in twice.

    So your post 7 code probably looks like this
    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";
    $listing_sql .= " order by p.products_date_added DESC, p.products_sort_order, pd.products_name";
       break;
    Last edited by gilby; 29 Jul 2013 at 01:40 AM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. show all categories and sub categories on each page
    By szarin in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Jun 2011, 05:56 PM
  2. how to make sub categories to show by default?
    By raulmalik in forum Basic Configuration
    Replies: 4
    Last Post: 8 Apr 2011, 04:46 AM
  3. Make categories show products of all sub cats
    By Djulli in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 Dec 2009, 03:10 PM
  4. Sub Categories show with New Products
    By MiraBella in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Dec 2009, 02:10 AM
  5. How to make top category to show products instead of sub-categories?
    By MKdiable in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 12 Oct 2009, 11:55 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