Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Jan 2008
    Posts
    26
    Plugin Contributions
    0

    help question Hide sold out products from category listings and search without disabling product.

    I have products that are completely discontinued, that I will probably never sell again and they have 0 quantity in stock, the shopping cart button says sold out... all of this is fine, however...

    I don't want them to show up under the category listing and searches performed by zencart as it clutters the products I do have in stock. I know I could just disable the product, which I would love to but it makes the link to the product no longer work.

    I would like search engines and other links which point back to a product on the site to be able to see a discontinued product if the exact url is used. I just do not want discontinued products to show up unless that is the case, is this possible to do?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Hide sold out products from category listings and search without disabling produc

    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Hide sold out products from category listings and search without disabling produc

    Quote Originally Posted by kobra View Post
    Ready through that whole thread, I figured all that out already. ZenCart allows you to show a product which is out of stock by setting the configuration that shows the soldout button instead of add to cart button if quantity = 0.

    Since I don't want to see all those sold outs on the category listing/search pages I also have the option to set the product_status = 0, either through the stock configuration or manually through the edit product view. Which hides all products on the frontend of the website.

    That's all find and dandy, exactly how I want it in fact, however there is one instance that I want the products to show up. And that is if you manually go the the exact url of the product. Then I want the product to show the out of stock page.

    This is so search engines that already have links to the product and other websites that linked to it in the past don't get a product not found page, rather they get a product out of stock page. In other words I don't want links which used to work to no longer work anymore. (broken links)

    Just wondering if I will have to hack Zen Cart to do this, or if there is another way? Cause the only thing that I can think of is changing some of the queries to not pull products with quantities of 0 or less. Or writing a custom configuration, will have to dig through you code to see how this is done.
    Last edited by illum; 5 Jan 2011 at 08:23 PM.

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

    Default Re: Hide sold out products from category listings and search without disabling produc

    Edit the file:
    /includes/index_filters/default_filter.php

    and add the code around line 27 that is in red above the code in black:
    Code:
      $alpha_sort .= " and p.products_quantity > 0 ";
      if (!isset($select_column_list)) $select_column_list = "";
    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
    Jan 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Hide sold out products from category listings and search without disabling produc

    Quote Originally Posted by Ajeh View Post
    Edit the file:
    /includes/index_filters/default_filter.php

    and add the code around line 27 that is in red above the code in black:
    Code:
      $alpha_sort .= " and p.products_quantity > 0 ";
      if (!isset($select_column_list)) $select_column_list = "";
    Did exactly what I wanted, thanks!

  6. #6
    Join Date
    Jan 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Hide sold out products from category listings and search without disabling produc

    Do you know the path of the file that I need to edit to add to the 'p.products_quantity > 0' to the search query?

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

    Default Re: Hide sold out products from category listings and search without disabling produc

    I gave you the exact location of that file ...

    Look at your site and you will find the file in that location ...
    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!

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

    Default Re: Hide sold out products from category listings and search without disabling produc

    Quote Originally Posted by Ajeh View Post
    Edit the file:
    /includes/index_filters/default_filter.php

    and add the code around line 27 that is in red above the code in black:
    Code:
      $alpha_sort .= " and p.products_quantity > 0 ";
      if (!isset($select_column_list)) $select_column_list = "";
    Nice one Ajeh! Thanks a lot - that code should be a permanent one in all installs for SE purposes ...

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

    Default Re: Hide sold out products from category listings and search without disabling produc

    Thanks for the update that this is now working 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!

  10. #10
    Join Date
    Nov 2010
    Posts
    20
    Plugin Contributions
    0

    Default Re: Hide sold out products from category listings and search without disabling produc

    Hi Ajeh,

    Nice job! I applied this as a test for my products and it works like a charm. I will not be able to use it on my site as there are some products that I do still want to show as a Sold Out...ones that I am still replenishing stock on and want the customers to see that I still carry it. And that's ok...I'll carry on as I currently am.

    The only reason I mention this is that it might be a good future addition to the software to add some flexibility to a feature like this, even if it was embedded as an option for each product id. For example, we decided to sell watches during the fall on a limited basis. We now have the remaining watches on Clearance and do not plan to re-order them. I still want the links through the search engines to show 'Sold Out' and want the menu filter to not show them anymore. But I do have a purse that I also sold out of, but will be receiving new shipments soon. I have customers that search for this type of purse and I want it to appear within the menu even when 'Sold Out' so they know I offer the product.

    If you can think of possibilities around this, great! Certainly not a priority, just a thought...
    Thanks for the help.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Hide Normalprice for sold out products & in product listing page ONLY!
    By Green Books in forum General Questions
    Replies: 1
    Last Post: 4 Oct 2015, 06:06 PM
  2. Hide out of stock products from advanced search
    By solo_400 in forum Basic Configuration
    Replies: 4
    Last Post: 28 Mar 2013, 06:08 PM
  3. Hide upcoming products from all and category listings
    By jmsnyder23 in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 8 Mar 2012, 02:44 PM
  4. Hide Sold out product from Product Listing page
    By needsome in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 7 May 2011, 06:49 PM
  5. Replies: 7
    Last Post: 28 Mar 2011, 04:08 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR