O'Reilly logo

eBay Hacks, 2nd Edition by David A. Karp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #61. Allow Visitors to Search Through Your Listings

Put an HTML search form in your auction description to make it easier for your customers to find other items you're selling.

People have short attention spans. This is never more clear than when you're searching eBay and…wait, what was I talking about?

The "View seller's other items" link that appears at the top of each of your listings allows customers to see other items you're currently selling using standard eBay search pages. This means that people viewing your item can click the link and then search through your listings [Hack #18] on the next page, provided they remember how they got there in the first place.

Instead of taking the risk of losing your customers to some other page, you can include a search box, shown in Figure 4-20, in each of your listings to help keep your customers on track.

A search-by-seller box in your auctions helps promote your other items

Figure 4-20. A search-by-seller box in your auctions helps promote your other items

The Code

To put this box in your auction, simply place the following code somewhere in your auction description:

<table border=0 cellpadding=0 cellspacing=0 width=200>
<tr>
<td colspan=4 bgcolor=#FFCC00><img
        src="http://pics.ebaystatic.com/aw/pics/s.gif" width=1 height=1></td>
</tr><tr>
<td width=1 bgcolor=#FFCC00><img 
        src="http://pics.ebaystatic.com/aw/pics/s.gif" width=1 height=1></td>
<td colspan=2><table cellpadding=0 cellspacing=0 border=0 width=100%> 
<tr>
<td bgcolor=#FFE684 width=100%><table cellspacing=0 cellpadding=0 border=0 width=100%>

<tr>
<td height=22 width=4 background= 
"http://pics.ebaystatic.com/aw/pics/listings/subHdrOrange_4x22.gif" 
><img src="http://pics.ebaystatic.com/aw/pics/s.gif" height=22 
width=4></td><td height=22 width=4><img src=
 "http://pics.ebaystatic.com/aw/pics/s.gif" height=22 width=4></td>
<td><b>Search This Seller</b></td>
</tr></table></td>
<td bgcolor=#FFE684><img src=
        "http://pics.ebaystatic.com/aw/pics/s.gif" height=1 width=15></td>
</tr><tr>
<td colspan=2><img src= 
        "http://pics.ebaystatic.com/aw/pics/s.gif" height=5 width=1></td> 
</tr></table>
</td> <td width=1 bgcolor=#FFCC00><img src= 
        "http://pics.ebaystatic.com/aw/pics/s.gif" width=1 height=1></td> 
</tr><tr>
<td width=1 bgcolor=#FFCC00><img src= 
       "http://pics.ebaystatic.com/aw/pics/s.gif" width=1 height=1></td> 
<td width=4><img src="http://pics.ebaystatic.com/aw/pics/s.gif" 
width=4 height=4></td>
<td>
 <form name="advsearch_form" style="display:inline"
action="http://search.ebay.com/ws/search/SaleSearch">
<nobr>
 <input type="text" name="satitle" maxlength=300 size=20 value=""> <
input type="submit" value="Search"> <br></nobr>
 <input type="checkbox" name="fts" value="2"> 
Search title <b>and</b> description

<input type="hidden" name="fsop" value="1&amp;fsoo=1">
<input type="hidden" name="fcl" value="3">
<input type="hidden" name="frpp" value="200">
<input type="hidden" name="seller" value="1">
 <input type="hidden" name="sass" value="my_ebay_id">

   </form> 
</td> 
<td width=1 bgcolor=#FFCC00><img src=
        "http://pics.ebaystatic.com/aw/pics/s.gif" width=1 height=1></td> 
</tr><tr> 
    <td width=1 bgcolor=#FFCC00><img src= 
            "http://pics.ebaystatic.com/aw/pics/s.gif" width=1 height=1></td> 
<td colspan=2><img src= 
            "http://pics.ebaystatic.com/aw/pics/s.gif" width=100% height=15></td> 
<td width=1 bgcolor=#FFCC00><img src= 
            "http://pics.ebaystatic.com/aw/pics/s.gif" width=1 height=1></td> 
</tr><tr> 
<td colspan=4 bgcolor=#FFCC00><img src= 
           "http://pics.ebaystatic.com/aw/pics/s.gif" width=1 height=1></td> 
</tr></table>

The only thing you have to do before you use this form in your own listings is replace my_ebay_id on line with your own eBay member ID to confine the search results to your own running auctions. The code can otherwise be used exactly as is.

Since this box has a genuine eBay look, complete with the yellow lines and even the "Search title and description" checkbox, it's somewhat more complicated than it otherwise would need to be. In fact, the actual search form is comprised only of the code between lines and . But the official eBay appearance will make your bidders more comfortable using it, as well as make your listing look more professional.

Hacking the Hack

Here are some things you can use to customize the search box:

Custom table.

Naturally, you can customize your search box to suit the style of your auctions by replacing all the code above line and below line with a custom table [Hack #52] . Just be careful not to disturb the code within the <form></form> structure.

Right-justify

As it is, the box will appear left-justified in your listing. To right-justify it, add the align=right parameter to the <table> tag on the very first line, like this:

<table border=0 cellpadding=0 cellspacing=0 width=200 align=right>

Or, to center the table, use this:

<table border=0 cellpadding=0 cellspacing=0 width=200 align=center>

Open in a new window.

Don't let your bidders forget where they came from. Instead of the search results appearing in the same window, you can have the search open a new window simply by adding the target="_blank" parameter to the <form> tag on line , like this:

<form name="advsearch_form" style="display:inline" target="_blank"
            action="http://search.ebay.com/ws/search/SaleSearch">

Enable descriptions by default.

To turn on the "Search title and description" checkbox by default, which will likely increase the number of search results your bidders see (thus increasing the exposure of the corresponding auctions), just add the checked parameter to the <input> tag on line , like this:

<input type="checkbox" name="fts" value="2" checked>

Default search

Finally, if you have a lot of different auctions running at once, you may want to show your customers results that are more likely to interest them. For instance, if the form is appearing on a wireless phone accessory, pre-fill the satitle field with the search word "wireless," like this:

<input type="text" name="satitle" maxlength=300 size=20 value="wireless">

Thus, the customer need only click the Search button to view a listing of relevant listings.

The search box can help sell multiple items to buyers who would otherwise purchase only a single item from you. Another way to promote your other products is to place links to your listings in your description [Hack #60] .

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required