Site searches

This is part of the Stockashop Manual. It discusses the Stockashop search page and how you can customise it.

The Search Box

If your Stockashop has the search feature, then a search box appears in the top left corner of every page of your site. When you search for something here, it returns a list of products (not pages or categories) containing the search term in the following fields: name, description, keywords, summary, main category.

If you put in a phrase, it returns any products matching any word in the phrase. So if you search for pink shorts, it returns products containing pink AND products containing shorts. (Unless you put your search term in quotes - then it will search for the whole phrase.)

Products are listed in alphabetical order, the same way as on a product category page.

Search Parameters for Custom Searches

The search page is quite powerful and you can easily setup custom searches. This section shows all the parameters you can pass into the search page, and the next section describes how to do it. As a quick example, a link such as search.php?searchfor=bikes&priceto=200&showtitle=yes? will search for all bikes up to ?200, and show the title of the results as "Bikes".

  • search: the text to search for in the product's name, description, keywords, summary, and page's name. Common words like "and", "the" and "a" in the search phrase are ignored
  • search[]: you can pass in multiple "search[]" terms and they will be joined into a single search, which is very useful if you're using a form with different dropdowns
  • type: pass in the "type" as "keywordsonly" and it will only search the product's keywords - which can be useful if you want to search by some word or term which you don't want the customer to know about (like a serial code). Pass in "optionsonly" to search only product option names.
  • phrase: normally the search looks for any word that was typed in, but you can make it search for a specific phrase by passing in "yes"
  • search in quotes: if you put quotes around the entire search term it forces it to search by phrase as above
  • pricefrom: search for products greater than or equal to this price
  • priceto: search for products less than or equal to this price
  • date: for sites with the "event listings" feature, you can search for products/events on this date by passing in something like date=6?March?2009
  • datefrom: as above, show products/events from this date, can be used alone or in combination with dateto
  • dateto: as above, show products/events up to this date, can be used alone or in combination with datefrom
  • flag: this will look for all products with the corresponding product flag set such as flag=on%20sale (example flags are "new product", "on sale" and "special offer"). You can pass in a plural and the "s" will be stripped but still shown in the title.
  • showtitle: pass in "yes" and the seach page will show the search term as the title, or pass in anything else to set the title explicitly
  • showtext: you can override the default text by passing it in as this parameter
  • redirect: pass in "always" and the search results page will automatically redirect to the first product found if there were any, pass in "yes" and it will only redirect if the search returned exactly one result
  • Search results pages are not created automatically in the page list, but can be added by designers. Once created, you can edit the text of the page. The default text for a successful search is "We found products matching your search for ..." For no results it is "Sorry we didn't find any matching products for ..."

Custom Search Links

You can link directly to the search page.

Custom Search Forms

You can also put a form.

Searching by Date for Events

Stockashop offers an events feature, which lets you assign a date to a product.

Saved Searches

Search results pages are not created automatically in the page list, but can be added by designers. Once created, you can edit the text of the page. The default text for a successful search is "We found products matching your search for ..." For no results it is "Sorry we didn't find any matching products for ..."

?

This manual is in progress and will be completed soon (Oct 2010)

LOGIN AREA

CONTACT US TODAY?

Ecommerce website logo

Ecommerce website

Websites that are the real business
empowering and profitable

Brochure website logo

Brochure website

We'll have you online
in one day

Ecommerce consultancy logo

Ecommerce Consultancy

Impartial advice on ecommerce
We'll even write your specification