Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jun 2006
    Posts
    440
    Plugin Contributions
    0

    Default Sold Out Ta Back of Listing

    Hi there
    is there a code to make to sold out items appear last when searching eg
    when on the product and using the next previous button I only show sold out units not whats in stock, I would think eventually I would get to the stock a few hundred clicks later but first and foremost I show sold out.
    Thanks
    Best Regards
    Renz

  2. #2
    Join Date
    Oct 2011
    Location
    AZ
    Posts
    384
    Plugin Contributions
    0

    Default Re: Sold Out Ta Back of Listing

    Quick answer is no, you can't sort by stock quantity. It's not one of the default sort orders. You can set it so that when an item is sold out it doesn't show at all, but if you want it to show but bump it to the bottom of the list then you'll have to find some way of coding it.

  3. #3
    Join Date
    May 2010
    Location
    Arkansas
    Posts
    33
    Plugin Contributions
    0

    Default Re: Sold Out Ta Back of Listing

    I can do some coding for you if you would like. PM me and we can talk in more detail.

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

    Default Re: Sold Out Ta Back of Listing

    You would need to alter the SELECT statements where you want this to happen ...

    And example of how to make the Sold Out last would be:
    Code:
    SELECT  products_id, products_model, products_status, products_quantity,  (products_quantity > 0) AS sort_sold from products order by sort_sold  DESC, products_model
    This pulls the fields products_id, products_model, products_status, products_quantity and creates a new one, sort_sold, and then in the ORDER the sort_sold DESC before the products_model of the ORDER statement puts the Sold Out Products, products with products_quantity <= 0, last ... but it is in the ORDER of the products_model ...

    NOTE: products_quantity does not need to be part of the SELECT, it is just there to test this ...
    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!]
    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
    Jun 2006
    Posts
    440
    Plugin Contributions
    0

    Default Re: Sold Out Ta Back of Listing

    Quote Originally Posted by Ajeh View Post
    You would need to alter the SELECT statements where you want this to happen ...

    And example of how to make the Sold Out last would be:
    Code:
    SELECT  products_id, products_model, products_status, products_quantity,  (products_quantity > 0) AS sort_sold from products order by sort_sold  DESC, products_model
    This pulls the fields products_id, products_model, products_status, products_quantity and creates a new one, sort_sold, and then in the ORDER the sort_sold DESC before the products_model of the ORDER statement puts the Sold Out Products, products with products_quantity <= 0, last ... but it is in the ORDER of the products_model ...

    NOTE: products_quantity does not need to be part of the SELECT, it is just there to test this ...
    Hi Ajeh,
    could you please tell me where I would make those changes, is it in the admin or hard coding, if the latter could you psl give me the path.

    Cheers
    Renz

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

    Default Re: Sold Out Ta Back of Listing

    You would need to add that to the store catalog SELECT statements where you want this to happen ...

    There are a lot of SELECT statements, so you would need to be much more specific on where you want the Sold Out products to come last ...
    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!]
    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!

  7. #7
    Join Date
    Jun 2006
    Posts
    440
    Plugin Contributions
    0

    Default Re: Sold Out Ta Back of Listing

    Quote Originally Posted by Ajeh View Post
    You would need to add that to the store catalog SELECT statements where you want this to happen ...

    There are a lot of SELECT statements, so you would need to be much more specific on where you want the Sold Out products to come last ...
    Hi Ajeh, thanks for your reply, I would basically like to show whats in stock when the customer presses the next button on the product page,where the three buttons are previous listing next.

    When clicking next on mine it shows a couple of in stock items and then everything that is sold out or qty 0, which I still keep in the database but choose not to display, even after all the products, though it does bring them up for some reason when clicking next.

    Cheers
    Renz

  8. #8
    Join Date
    May 2011
    Posts
    17
    Plugin Contributions
    0

    Default Re: Sold Out Ta Back of Listing

    Find:

    $sql = "select p.products_id, p.products_model, p.products_price_sorter, pd.products_name, p.products_sort_order
    from " . TABLE_PRODUCTS . " p, "
    . TABLE_PRODUCTS_DESCRIPTION . " pd, "
    . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
    where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id= '" . (int)$_SESSION['languages_id'] . "' and p.products_id = ptc.products_id and ptc.categories_id = '" . (int)$current_category_id . "'" .
    $prev_next_order;

    Replace with:

    $sql = "select p.products_id, p.products_model, p.products_price_sorter, pd.products_name, p.products_sort_order
    from " . TABLE_PRODUCTS . " p, "
    . TABLE_PRODUCTS_DESCRIPTION . " pd, "
    . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
    where p.products_status = '1' and p.products_quantity > '0' and p.products_id = pd.products_id and pd.language_id= '" . (int)$_SESSION['languages_id'] . "' and p.products_id = ptc.products_id and ptc.categories_id = '" . (int)$current_category_id . "'" .
    $prev_next_order;

    it should solve your problem. :)

  9. #9
    Join Date
    Jun 2006
    Posts
    440
    Plugin Contributions
    0

    Default Re: Sold Out Ta Back of Listing

    Thanks for that, where would i find that code, can you pls give me a path...
    Regards
    Renz

  10. #10
    Join Date
    May 2011
    Posts
    17
    Plugin Contributions
    0

    Default Re: Sold Out Ta Back of Listing

    catalog/includes/modules/product_prev_next.php

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Sold Out image on product listing
    By Theo in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 23 Oct 2011, 03:46 PM
  2. Replies: 7
    Last Post: 28 Mar 2011, 04:08 AM
  3. Replies: 6
    Last Post: 18 Oct 2010, 06:42 PM
  4. Listing an item as sold out
    By ncd in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 25 Jul 2007, 05:36 AM
  5. product listing 'sold out' image is missing!
    By notrub225 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 22 Sep 2006, 02:04 AM

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