Code to prevent Out Of Stock Listings in Search?

Hi! I’m about to launch my search button widget, but I’ve noticed that out-of-stock listings are appearing first in the search results. I’m concerned this may frustrate customers. Has anyone successfully added custom code to prevent out-of-stock items from appearing in the search results, or at least to make them appear last?

Also is there a way to add custom code to have the search show up by state? For example “Puppies in Michigan”?

Test Link: https://2c4492ced89640b7a3098e246779470f.elf.site

Wish list idea: Add filters to the search widget! Sort by price, availability, product, etc.

2 Likes

Hi there, @Courtney_Dean :wave:

Unfortunately, it’s impossible to exclude the specific pages from the search result, but we have this idea on the Wishlist. Feel free to upvote it - Exclude specific categories/pages from Search results.

I am not sure if it’s possible to display the out-of-stock listings at the bottom, but I’d be happy to check it with the devs. Could you just send me a link to the page, where your widget is installed?

Regarding this idea, I am afraid I don’t quite get it. Could you please elaborate on what you mean?


The request for the filter option is already on the Wishlist. You can upvote it here :slightly_smiling_face: - Add Filter option

2 Likes

Thank you so much for your reply! I’ll vote it up!

The test page is here: https://www.pawrade.com/tacos. The placement isn’t quite right yet, but you can still test it out.

If you click the search icon (top right/little grey floating button), type “Goldendoodle,” and select the first link, you’ll see the first puppy that has already been adopted but is still appearing on the site. It will be placed correctly in the header before we deploy.

We have a lot of available puppies in that breed on our site so I am a little worried people won’t see them. Goldendoodle for Sale | Puppies | Pawrade.com I noticed this happening with multiple breeds.

For my third question, when I searched “puppies located in Michigan”, our landing pages by breed/state were not showing up but they are now. So no need to address that anymore. It was an issue on my end! :blush:

Thanks again!!

2 Likes

Hi there, @Courtney_Dean :wave:

Got it, thanks!

It’s possible to create a custom script that will remove the links with the sold puppies from the search. However, once the new puppy is sold, you’ll have to manually add the new link to the script to remove it from the search.

If you’d like to proceed this way, please let me know and I’ll pass your request to the devs :slightly_smiling_face:

1 Like

Thank you! I will let you know. Manually adding them will be too much I think because we have thousands of listings. I am going to see what I can do on my end to hide them from the page.

2 Likes