Industry guru Dave Taylor offers tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.     


How can I add an eBay search box that searches titles and descriptions?

Dave, I got the search box into my site (as detailed here: Add an eBay search box to your Web site) but I need to be able to use it to search both title and description. I have not had any luck getting that part in. I need this because I encode the description of an eBay listing with a specific number giving my customers an easy way to look at their items only. Thanks for the help


Dave's Answer:

The default eBay search is pretty easy to emulate because, well, it's simple. Being able to duplicate the more sophisticated functionality of its advanced search is a bit more tricky, because we need to crack open the HTML itself and see what's inside.

The default search is certainly attractive enough:

eBay Advanced Search

Crack open the HTML code, however, and the form is insanely complicated, so complicated that I couldn't really make head nor tail of it without stripping away some of the core functionality. Nonetheless, assume you always want to check all categories and the basic search form can be reduced to:

<form method="get" action="http://search.ebay.com/search/search.dll">
<input type="hidden" name="from" value="R40" />
<input type="hidden" name="_trksid" value="m37" />
<input tabindex="1" type="text" name="satitle" id="satitle" value="" maxlength="300" size="30" />
<input type="hidden" name="category0" value="" />
<input type="submit" value="Search" tabindex="3">
</form>

here's the cool thing, though. Search through the source code for "Search title" and you'll find that there's a single checkbox value that makes that option work:

<input type="checkbox" name="fts" value="2" />Search title <b>and</b> description<br />

My question, therefore, is what happens if I just make this checkbox available in the simple form shown earlier? Just literally copy and paste that single line of HTML. Here's the result:

  Search title and description

A bit of testing will reveal that it works perfectly! If you want to just hide the setting, turn the checkbox into a hidden variable, paying attention to the default value that the eBay server wants to receive (detailed in the original HTML):

<input type="hidden" name="fts" value="2" />

Further experimentation shows that some of the variables being sent are unnecessary! In fact you can do just fine with the following code, added line for the checkbox highlighted in bold:

<form method="get" action="http://search.ebay.com/search/search.dll">
<input type="text" name="satitle" value="" maxlength="300" size="30" />
<input type="checkbox" name="fts" value="2" /> search titles and descriptions<input type="submit" value="Search" tabindex="3">
</form>

Or, if you want the minimal search box and know that every time someone wants to search, they really want both title and description:

<form method="get" action="http://search.ebay.com/search/search.dll">
<input type="hidden" name="fts" value="2" />
<input type="text" name="satitle" value="" maxlength="300" size="30" />
<input type="submit" value="Search" />
</form>

Hope that helps you customize your page!


More Useful Auctions and Online Shopping Articles:
✔   How can I sell a used gadget on Amazon.com?
I have a bunch of electronic gadgets in my office that are just sitting around and I notice that they're worth a decent...
✔   How do I return something to Amazon.com?
Hey Dave, I bought a new backpack through Amazon.com and when it arrived, I realized I didn't like it and really want to...
✔   What annual subscriptions do I have set up in PayPal?
As it's the last day of the year, I'm thinking about recurring billing that's going to kick in starting again in 2013 through...
✔   What's a used computer really worth?
Hi Dave. I bumped into this note on Facebook, a post from a friend: "Thinking about selling my 17" MacBook Pro. It's 3...
✔   How long have I been a member of eBay?
I was arguing with a friend the other day and he said that he'd been on eBay since it first came online. I...

Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
    Enter your name: and your email addr:  








Reader Comments To Date: 15

Pradeep Kumar said, on February 23, 2008 4:15 AM:

I'd add this box into my site and it's working just fine

Graham Bae said, on October 7, 2008 9:06 AM:

Hi Dave,

I must say, I love your work!

I wanted to implement a similar thing on my eBay store site, but I'd rather have a neat little box in a position of my choice, instead of using the ugly default eBay side menu.

Is there a way to customise the search form so it only searches within my eBay store?

Thanks in advance for any help you can offer!

Dave Taylor said, on January 3, 2009 7:46 AM:

Graham, thanks for the kudos! You can indeed create an eBay merchant search box. See here:

http://www.askdavetaylor.com/how_to_make_ebay_store_merchant_search_box.html

See especially the follow-on comments too!

Marisa said, on February 17, 2009 8:00 AM:

Hello
How can I add a search box to my ebay store pages that will allow the search to work only for the page that it is started on ? In other words when someone finally gets to a page called The Dark Room which only has vintage photos on it I want the search to bring up items only on that page.

Thanks

Harland said, on March 22, 2009 6:15 AM:

Dave,

As always a great post. I do have a question for you though. Is there anyway to insert our ebay campaign id from epn into the code?

Dave Taylor said, on March 23, 2009 6:04 PM:

Harland, I'm afraid I don't really know what you're talking about with eBay Campaign ID and EPN. Can you point me to a page that has a search engine that does what you want?

Jody said, on April 6, 2009 12:55 PM:

Hi Dave, this is fantastic stuff!

I would like to know if it is possible to add a hidden word to the search so that when a user clicks the search button, this word is added to what the user put in?

Hope that makes sense!

Thanks very much in advance.

Ian said, on July 14, 2009 1:04 PM:

Might you point me to someone to code a script to search eBay completed listings using specific criteria, and export the results to XLS?

iMacros hang up repeatedly.

Thnx.

Ian

Cycle Tech said, on April 5, 2010 8:09 AM:

Hi Dave

How do you make the search box open a new window?

My ebay shop blog: > http://mobilebicyclerepairs.blogspot.com/2010/04/ebay-shop.html

Thanks

Cycle Tech said, on April 5, 2010 8:35 AM:

Hi Dave, I just see on your other page: http://www.askdavetaylor.com/how_can_i_add_a_froogle_search_box_to_my_site.html

add target="_blank" to the form tag and you'll ensure that the search results appear in a new window

Thanks

james said, on June 12, 2010 7:42 AM:

Try eBay Box chrome extension. It is the simplest and fastest way to search in eBay.
https://chrome.google.com/extensions/detail/bfddajbopgkanlcndhkoogkdjkdhlndf

Jon said, on July 7, 2010 11:25 AM:

Can you provide me the url / syntax for looking up items sold, the price and the seller etc so I can see what things actually sold for rather than what they are priced at.

Thanks, Jon

Sagar said, on November 24, 2012 12:28 AM:

Hey Dave,
Nice work. I wanted to ask that I wanna specify a category (say Mobiles). But the categories for different countries are different. So can you tell me should I do. I am using your search box and sending it directly in anchor. Now I want to use my affiliate id appended to this search url. Can you help me with it

Mark said, on April 12, 2013 1:30 AM:

Hi Dave,

I have a problem with my ebay store,
I created a custom template with custom search engine. but when i tried to search a product the search result appears in the page without the template. I dont know how to fix it. Please advice. Thanks Dave.

Tom 6 said, on April 22, 2013 9:26 AM:

Hello Dave,
I added this in dreamweaver and it works fine in all the preview/live views
BUT not at all when uploaded to the FTP, i keep getting the 403 error.
can you help?

Tom

Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

I do have a comment, now that you mention it!











I will never send you any unsolicited email. Ever.






Check This Out Too...

 
Look for Answers
Need Help? Ask Dave Taylor!


Follow Me on Pinterest

Find Me on Google+
ADT on G+
© 2002 - 2013 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. My lawyer says "Thanks".
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.