Help with PicoSearch

Will PicoSearch work in a shopping cart system? (adding runtime url data)

Yes! PicoSearch supports several kinds of shopping carts, and it's quite possible that everything will work perfectly the first time. Try adding PicoSearch to a test page on your site. What's important is to make sure that your shopping cart is preserved before and after doing a search. You want to test that product selections aren't lost. Select some products to fill your shopping cart, then try PicoSearching from your site. Click on a search result to go back to your site through PicoSearch, and then check your shopping cart to see if its contents are still all there. The easiest case is if your shopping cart is attached by cookies in the user's browser, then going in and out of your PicoSearch search won't cause any problems at all.

But if your shopping cart does lose its contents after searching, don't panic, PicoSearch provides ways of adding runtime url data that can be used for many things including to preserve the state of a shopping cart. For general descriptions of how to redirect urls, see this FAQ. For examples used in shopping carts, see below.

Anyone can use prepath and postpath arguments for special run-time url information, just be sure that they work for all urls in your search engine. For example, if you have default directory links that just end in a /, the prepath and postpath may not work for you without a filename, so your Entry Point and site links may then need to have the filename explicit such as index.htm, not the default /. Postpath is smart enough that if it starts with ? to add arguments to a url, and the url already has some args, then postpath uses & to append more args. Also, you can use the nopath argument to specify which urls should not get the prepath and postpath attached. See the redirects FAQ for general definitions of prepath, postpath, and nopath. Continue reading for the Mercantec shopping cart example.

(Incidentally, when indexing your search engine, if your shopping cart system generates a lot of extra page links that PicoSearch doesn't need to follow, you may want to use the Excluded Paths section of your account manager to make PicoSearch look at just the unique page views of your site).

If your shopping cart depends on special arguments being preserved in the links at searching time, then this can be supported with deliberate arguments. For example, PicoSearch has been proven to work well in the popular Mercantec Soft-Cart system as an accurate and free or low-cost alternative to server searching scripts which tend to be expensive and less flexible. The trick is to use two search call-time arguments, prepath and postpath, to pass the state of your current user's shopping cart. These are easily added to the cut-and-paste HTML code by you. PicoSearch will plug the values you pass into the result page urls, so you can then preserve the shopping cart and send it back to your site when your visitor clicks on something he has found by a search.
 
Depending on your shopping cart configuration, you may need to make sure that you have a "side-door" script in your system that allows PicoSearch to jump into both the sections inside and outside of your shopping cart. For Mercantec, the use of Triangle Research's free side door script (or scripts similar to it from other sources) will let your users search your entire site, including your Softcart store pages, from outside the Softcart storefront. Please be willing to experiment to find what works for, and be guided by the following information.
 
To continue with the Soft Cart example, the first argument "prepath" will specify where the Soft Cart exectuable is located on your site, and the second argument "postpath" will hold the values that Soft Cart needs to continue the shopping cart, including a unique session identifier which Soft Cart should fill in before calling PicoSearch. The "prepath" will get inserted between your domain name and every page link back to you, because this is how Soft Cart inserts itself into the pages on your site. The "postpath" will get appended to every page link to maintain the current user's shopping cart. The PicoSearch indexer can crawl your site just fine without knowing about Soft Cart, and it is only in the search results that PicoSearch needs to be told the shopping cart that must be preserved. PicoSearch will format its own links accordingly, and if your template needs the prepath and postpath data, PicoSearch will also substitute them where-ever it sees _PICOPREPATH and _PICOPOSTPATH, respectively.
 
The "cut and paste" html code below can be installed on a search page that is called by menu choices within your store front, and would typically replace a softcart search page like "scstore.html" that may be created when you generate your Softcart site pages. The Softcart example below shows the additional arguments for typical values that you should add to the cut-and-paste from your account manager, along with some technical hints that may be relevant for your configuration. Notice that:
  • "NOPARSE#" probably needs to be inserted into the Form action. This is just a Softcart thing, nothing to do with PicoSearch.
  • In PicoSearch's prepath value, "cgi-local" or "cgi-bin" is commonly where the SoftCart executable is located.
  • In PicoSearch's postpath value, "%%softcart.sessionid%%" is the placeholder that Soft Cart should fill-in so the browser can call PicoSearch directly. For SoftCart versions before 5.0, this should be "%%softcart.cartid%%"
  • The %2B is the standard browser code for the "+" sign, which doesn't pass well by itself. Other codes you can try as needed include %26 for "&", and %3F for "?"
  • "USERGEN#" probably needs to be inserted in brackets just before the submit statement. This is just a Softcart thing, nothing to do with PicoSearch. USERGEN# preserves Softcart's state tracking while a search is being performed until the user returns to your site. USERGEN# then combines the "postpath" variables with the state track information to transparently allow pico search to work with your Softcart store pages.
<!-- Begin PicoSearch Query Box -->
<p><form method="GET" action="NOPARSE#http://www.picosearch.com/cgi-bin/ts.pl">
<input type="hidden" name="index" value="(your account ID)" />
<input type="hidden" name="prepath" value="cgi-local/SoftCart.exe" />
<input type="hidden" name="postpath" value="?L%2Bscstore%2B%%softcart.sessionid%%" />
<table bgcolor="white" cellspacing="0" cellpadding="0" border="0"><tr><td>
<table bgcolor="white" cellspacing="2" cellpadding="0" border="0">
<tr><td><a href="http://www.picosearch.com/" target="_top"><img border="0" src="/picosmall.gif" alt="PicoSearch" /></a></td>
<td><input type="text" name="query" value="" size="20" /></td>
<td><USERGEN#><input type="submit" value="Search" /></td></tr>
</table></td></tr></table></form></p>
<!-- End PicoSearch Query Box -->
If you want to add PicoSearch to your home page or general site pages outside of the shopping cart, then you can simply use the standard pico search "cut and paste" html code without any special arguments. In the case of Softcart, you simply must be sure you have the free Side Door script from Triangle Research installed on your softcart product pages so softcart.exe operates properly when users select a softcart page from their search results. For more information about the free side door script visit the add-ons page at http://www.triangleresearch.com/
 
If you have any file types or paths that should not go through the shopping cart system, then you should specify these as patterns in a "nopath" argument. Any files that match the one or more patterns will be popped up into a blank window outside of the shopping cart session. This is typically done for pdfs and other reference documents. For example, this nopath line with two patterns will catch all txt files, and files that come under a pdf directory: <input type="hidden" name="nopath" value="*.txt http://www.mysite.com/pdfs/*" />
 
One of the great values of Pico Search is that through partitioning your search index properly you can avoid conflicts with Softcart's store entrance procedures. For example, if one partition is your general site pages and the other is your store pages, you can prevent inappropriate movement from one area of your site to another easily. For more information, see the FAQ on Partitions.
 
We've tried to make this as easy as possible for you, without us actually knowing the specifics of your shopping cart system. You are welcome to try a Free account and just see how it goes - if any issues arise, then you can contact us, or ask your hoster for a list of vendors to support your shopping cart system. Some installation support may be unavoidable; we are grateful to Triangleresearch.com for their Mercantec support.

Back to FAQs