Forums / General Questions / can I prevent sold out items from appearing in search

can I prevent sold out items from appearing in search

Views: 6,293

Results 1 to 9 of 9
7 Jul 2016, 10:06 PM
#1
mespe avatar

mespe

Zen Follower

Join Date:
Sep 2014
Location:
ohio
Posts:
216
Plugin Contributions:
0

can I prevent sold out items from appearing in search

Just like title says, how can I prevent items with "0" quantity from appearing in searches?

7 Jul 2016, 10:16 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: can I prevent sold out items from appearing in search

Do you still want or still display such items on your site? (meaning that one could still get to them if the uri is known?)
From what search(es) are you trying to block the item(s)?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Jul 2016, 10:26 PM
#3
mespe avatar

mespe

Zen Follower

Join Date:
Sep 2014
Location:
ohio
Posts:
216
Plugin Contributions:
0

Re: can I prevent sold out items from appearing in search

After I sell a part, I move it to the "Sold" folder with "0" quantity.
All I want to do is prevent any item with "0" quantity from appearing in any search in my store.

7 Jul 2016, 10:37 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: can I prevent sold out items from appearing in search

mespe:

After I sell a part, I move it to the "Sold" folder with "0" quantity.
All I want to do is prevent any item with "0" quantity from appearing in any search in my store.

So is the "Sold" folder navigable by a customer at your site?

Point is that until a search engine detects that the product is no longer reachable, it will maintain it in its list. There are multiple ways to try to inform it of such, but generally speaking it takes a while for it to get to the search engine just like it takes a while for it to be removed.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

8 Jul 2016, 3:13 PM
#5
mespe avatar

mespe

Zen Follower

Join Date:
Sep 2014
Location:
ohio
Posts:
216
Plugin Contributions:
0

Re: can I prevent sold out items from appearing in search

No, you don't understand. I don't mean search engines, I'm talking about searching within the store, using the search button provided by zencart. Sorry if I wasn't clear in my OP

9 Jul 2016, 1:35 AM
#7
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Re: can I prevent sold out items from appearing in search

Hi mespe,

open this file:

includes/modules/pages/advanced_search_result/header.php

search for this line:
$where_str = " WHERE (p.products_status = 1

change it to:
$where_str = " WHERE (p.products_status = 1 and p.products_quantity > 0

10 Jul 2016, 4:21 PM
#8
mespe avatar

mespe

Zen Follower

Join Date:
Sep 2014
Location:
ohio
Posts:
216
Plugin Contributions:
0

Re: can I prevent sold out items from appearing in search

yaseent:

Hi mespe,

open this file:

includes/modules/pages/advanced_search_result/header.php

search for this line:
$where_str = " WHERE (p.products_status = 1

change it to:
$where_str = " WHERE (p.products_status = 1 and p.products_quantity > 0

I hope you mean header_php.php as that's the file in the advanced_search_result directory
,,, yes it works,,, THANKS

10 Jul 2016, 4:26 PM
#9
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Re: can I prevent sold out items from appearing in search

Potayto Potaato...

Yes that's the one.

You can also prevent sold out items from appearing in New Products listing, All Products listing and a few other places by doing a similar thing with the default_filter.php.