Search


VPCART search bar has a feature with suggestion results. Customers can perfom a quick product search and a list of suggestions will be displayed as the customer types.
Below is a preview of the search bar and the search result when a customer types “chair”:

 

It can be turned on or off with the following Software Configuration option.

 

xAjaxSearchEnable

Setting this to Yesto enable Ajax script for the auto search as described above. If you do not want the auto suggestion list when typing keyword, simply set to No.

 

In VPCART 8.00, we have added new configs to enhance your ajax search feature:

xAjaxSearchMinChars

Enter the minimum characters to start the ajax search.
Default value is 3.
This means if you enter 1 or 2 characters into the search box, the ajax search will not start unless you enter the first 3 characters, then ajax search will start to show the predictive result. You can change the minimum value to your own liking.

We will give you example, if you want the ajax search to start at least 5 characters entered. Then set this config value to 5.

Let’s say, you enter search keyword : pla (only 3 chars), then ajax search will not show result :


Or if you enter keyword: plan (only 4 chars) it will also not showing search result :


And after you have entered keyword : plant (5 chars) then it will show the predictive result:


xAjaxSearchPageSize

Enter number of max search result records for a page on the ajax search. Default is 10.

Example, if we set this config value to 5, then when we do a search for product keyword, it will list the result showing five records in the page.


 If we set the config value to 10, then it will list 10 records of search result in page.

 

The search page “shopsearch.asp” allows your customers to enter key terms that describe the products they are looking for.

 

VPCART allows you to customize this page to specify what fields the customer can search on, whether category searches are allowed and whether the customer can search by price.

VPCART 8.00 has fixed the previous version where when you click the “Product Categories” dropdown in the search form, and when you choose category that have sub categories, you can now get results and see the listing of products.

 

Programming Note: If you want to write your own search facility, all you need to do is create an HTML form, then have it generate SQL based on the customer’s selections. Assign this SQL to the session variable SQL (use VPCART notation – setsess “SQL”, mysqlquery) and redirect the page to shopdisplayproducts.asp, which will generate a list based on your criteria.