Zen Cart Logo
Forums / General Questions / Excluding sold products from the search

Excluding sold products from the search

Views: 1,899

Results 1 to 10 of 10
11 Sep 2007, 5:27 AM
#1
lisk avatar

lisk

Zen Follower

Join Date:
Jun 2006
Posts:
118
Plugin Contributions:
0

Excluding sold products from the search

Hi - Is it possible to modify the way the search function works so that it will not return sold products in its results? I have a category "gallery" of sold products because I do a lot of custom orders, but it's really starting to make my site search function pretty useless. I'm using 1.3.7 and my store is here: http://dichroicjewelry.net/glass

thank you :)
-Lis

14 Sep 2007, 11:37 PM
#2
lisk avatar

lisk

Zen Follower

Join Date:
Jun 2006
Posts:
118
Plugin Contributions:
0

Re: Excluding sold products from the search

Giving this a bump & hoping that someone can help me. :)

15 Sep 2007, 2:08 AM
#3
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Excluding sold products from the search

Open includes/modules/pages/advanced_search_result/header_php.php

Find

$where_str = " WHERE (p.products_status = 1
               AND p.products_id = pd.products_id
               AND pd.language_id = :languagesID
               AND p.products_id = p2c.products_id
               AND p2c.categories_id = c.categories_id ";

Replace by:

$where_str = " WHERE (p.products_quantity > 0
               AND p.products_status = 1
               AND p.products_id = pd.products_id
               AND pd.language_id = :languagesID
               AND p.products_id = p2c.products_id
               AND p2c.categories_id = c.categories_id ";

I'm assuming that your sold products have the quantity of 0.

15 Sep 2007, 2:18 AM
#4
lisk avatar

lisk

Zen Follower

Join Date:
Jun 2006
Posts:
118
Plugin Contributions:
0

Re: Excluding sold products from the search

Perfect! Thank you so much! :)

15 Sep 2007, 3:47 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Excluding sold products from the search

... or you could just set your cart to deactivate the sold products when their quantity becomes 0 ... Admin->Configuration->Stock
But that would exclude them everywhere ... and would negate the "gallery" idea you mentioned.

15 Sep 2007, 3:49 AM
#6
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Excluding sold products from the search

I think she has a special category for the sold products, so can't really do that.

15 Sep 2007, 5:21 AM
#7
lisk avatar

lisk

Zen Follower

Join Date:
Jun 2006
Posts:
118
Plugin Contributions:
0

Re: Excluding sold products from the search

Yes, that's right - I have a category that I'm using as a showcase of sold products (my customers base a lot of custom orders off of it) - I just move them there and reactivate them with a zero quantity when they sell. But they were totally interfering with the search and frustrating my customers so I'm super excited that it's fixed.

20 Mar 2008, 4:09 AM
#8
shinyadornments avatar

shinyadornments

New Zenner

Join Date:
Dec 2007
Posts:
19
Plugin Contributions:
0

Re: Excluding sold products from the search

This is great as I am using a sold gallery for the same purpose.

Is there also a way to keep sold items (ones with quantity 0) from appearing on the All Products page too?

10 Dec 2008, 6:05 AM
#9
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Excluding sold products from the search

Great tip, which I will apply to my sold gallery.

Is there a way to apply this same fix so that 0 quantity items don't rotate through "New Products"? I have my "New Product Listing - Limited to ..." set to "0= All Products", which is fine for my situation except for the sold gallery items.

I would prefer if the sold gallery only presents itself to those that actually visit the gallery.

Thanks!

16 May 2011, 4:57 PM
#10
amyn avatar

amyn

New Zenner

Join Date:
Jan 2011
Posts:
20
Plugin Contributions:
0

Re: Excluding sold products from the search

I just came across this and I am also wondering if there is a way to make sure my "sold category" does not show on the ALL PRODUCTS / NEW PRODUCTS links.

The way I am using the gallery mod is for IN STORE ONLY products and I don't want visitors thinking there is no stock at the physical location of the store, so I just want to remove those items from the all products and new products, because it displays OUT OF STOCK there. As opposed to when looking at the actual product, no price or quantity will display.