Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    May 2008
    Posts
    402
    Plugin Contributions
    0

    Default Sold-Out products to bottom of the page automatically

    Hello, doesn't anyone happen to know of the possibility to make sold-out products automatically be sorted to the bottom of the product list? It's not convenient to have to set a sort order for thousands of products, but they should still be displayed in the product listing, just not in between in stock items. Any advice would be terrific. Thank you!

  2. #2
    Join Date
    May 2008
    Posts
    402
    Plugin Contributions
    0

    Default Re: Sold-Out products to bottom of the page automatically

    Going one step further, as desired is the ability to separate the sold-out items from the in-stock items. With a title above the break "Sold Out Items". Right now, all setting the sort order does is moves them to the end of the list. Also impossible to do with so many items.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Sold-Out products to bottom of the page automatically

    There are utilities that can make changing the sort order simple(r). For example EasyPopulate V4 could be used setting the primary key as products_id, could export your product (by category if so desired), open the file, then for filter the product by quantity, then using the max() function identify the highest sort order currently applied, add a little to the first of the 0 quantity and number the sort order in some reasonable increment using a function (=row above+10 for example), save the file upload/import and that takes care of the first issue. The second well, depends on if you want a sold out product to show at all with non-sold out or if it has to exist starting on its own page, but thinking could review the returned data from the page split function and if a sold out product existed then to display your "above the fold" info.

    Just a thought, otherwise, could create some other "field" to use and then could add it to the list of sortable fields and filter product by that on default.

    A third option to have a sold-out section off of your main category so that the product there can be "viewed" (I know not exactly desirable but possible).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Sold-Out products to bottom of the page automatically

    In v1.5.x /includes/index_filters/default_filter.php is where the query is built to retrieve product-listing data.

    You could add changes there, or perhaps simply just add an observer to fire when an appropriate notifier hook is triggered, to apply your filter.

    (ie: first might be to change the order-by to make "products_status desc" be the first order-by clause; 2nd enhancement could be to let the visitor apply a filter and then you could check $_GET or $_POST to see if that filter has been set, and then instead of changing order-by you'd add a "where" clause for products_status = 1 for only-enabled, or make no change to "where" if the filter doesn't need to exclude sold-out items)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Sold New Products display Sold Out instead of price on index and products_new pages
    By dharma in forum Templates, Stylesheets, Page Layout
    Replies: 36
    Last Post: 1 Jun 2016, 09:29 PM
  2. v139h How to automatically turn off sold out categories
    By joew36 in forum General Questions
    Replies: 4
    Last Post: 24 Jul 2015, 01:17 PM
  3. Replies: 7
    Last Post: 28 Mar 2011, 04:08 AM
  4. Sold Out Items Appear At Bottom Of List?
    By JCJXXL in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Nov 2010, 06:33 PM
  5. Automatically Overlay a "Sold Out" on Attribute which is Out of Stock
    By Stenrique in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 10 Feb 2007, 06:54 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