[contact-form-7 id="24078" title="Feedback EN"]

Featured templates

ZenCart. How to manage products search

This tutorial is going to show you how to manage products search on your Zen Cart store.

Zen Cart has two sideboxes for search search.php and search_header.php. Both of them can be control both through the Admin > Tools > Layout Box Controller

The search.php sidebox is a conventional sidebox and can be turned on and off as normal. If you want search in the header, you will normally turn this sidebox off, though it does have the advantage of providing a link to the advanced search page.

The search_header.php sidebox is specifically designed to display a search box in your Zen Cart header and so doesn’t output all the HTML needed for a sidebox. It is recommended therefore that you ensure that its left/right column status is set to OFF, but that really is up to you. To display it in the header, set the single column status to ON.

When a customer performs a search in any of the search boxes in your store, the search results page is displayed. The search results (search product listing) use the same sort order as the other product listings (category product listing). The main difference between them is  the lack of category information in the Search product listing.

The configuration for the appearance of thise product listing is done via the same screen in the Admin Console.

To change the general display of the Search product listing, click on Configuration > Product Listing to access the Product Listing screen.

Click on a field you would like to change and follow the instruction in the corresponding side-panel to make your changes. When you are done with editing the properties, click on update to save your changes.

To change the number of items to display on the search results page:

  • Click on Configuration > Maximum Values to access the Maximum Values screen

  • Edit the Products Listing- Number Per Page field and click update to save your changes.

To change the number of pages show in the pagination, change the value in the Prev/Next Navigation Page Links field.

The source code of the product listing for both searches and category displays can be found in:

  • includes/index_filters/default_filter.php file
  • includes/modules/pages/advanced_search_result/header_php.php file

These files contain conditional statements that determine what SQL query should be executed.
The text for the Advanced Search page can be changed in the \includes\languages\english\theme###/advanced_search_result.php file.

Feel free to check the detailed video tutorial below:

ZenCart. How to manage products search