Custom Navigation Links
Previous  Top  Next

Custom Navigation Links
Custom navigation can be used to allow selection of only specific products or categories. Language selection can also be done through custom navigation links.

·Search URL - The search.php script can be called with a searchstring parameter. This will list only products that contain the searchstring in the name or description. A unique string of characters can be included in each product description. When a search is performed only matching products will appear. A customized search system can be created this way.  
Example: http://yourdomain.com/search.php?searchstring=productcode123  
 
Here is a tip for using search.php to filter the product listings. Include a unique text string in each product name or description. To group products in searches, use a simple product code. For instance a book that is fiction and is by an author with code name Hort and it is his 1st book might have a code "BFHort1". A link to search.php?searchstring=BFHort1 will display only that product. However, a link to search.php?searchstring=BFHort will display all of the fiction books by that author. To hide the product codes so that they do not appear in catalog pages, put the codes between HTML comment tags. <!-- productcode -->  
 
·Category URL - A specific category of products can be listed by including a cat= parameter in the URL to the page.  
Example 1: http://yourdomain.com/catalogue.php?cat=2 will open the catalog page products that are in category number 2.  
Example 2: http://yourdomain.com/shop.htm?cat=2 will open a custom catalog page showing products in category number 2.  
 
·Product URL - A specific product listing in the catalog may be displayed by calling catalogue.php and by including a product ID parameter.  
Example 1: http://yourdomain.com/catalogue.php?product=123 will open the catalog page showing product ID 123.  
Example 2: http://yourdomain.com/shop.htm?cat=2 will open a custom catalog page showing product ID 123.  

Redirect Parameters In Language Selection URLs
A redirect URL may be one of the parameters in a language selection URL. For example this URL will set the language preference to sp (Spanish) and redirect to http://thewebsite.com/redirect.htm.
http://thewebsite.com/language.php?language=sp&redirect=http://thewebsite.com/redirect.htm

Nesting Parameters Within Language Selection URLs
It may be necessary to include more than one parameter within the redirect URL. To add a product without setting a language preference, the shipping.php or basket.php script is called with parameters to specify product information.
http://thewebsite.com/shipping.php?product=26&quantity=1

What if you want to set the language preference AND add a product to the cart at the same time? If the redirect URL with more than one parameter is appended to the language.php URL with its multiple parameters a conflict is created. The ampersand between the redirect URL parameters will be interpreted by the browser as part of the first set of parameters, which will break the second set of parameters and prevent the product from being added to the cart. To enable nested parameters such as this, the language.php script recognizes the pipe character as a replacement for the ampersand.

Substitute the pipe character in place of the ampersand character in the redirect URL parameters to make the product and quantity parameters work. For example, this URL will set the language preference to sp and add quantity 1 of product 26 to the cart with one click.
http://thewebsite.com/language.php?language=sp&redirect=http://thewebsite.com/shipping.php?product=26|quantity=1