This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

In some instances, it's useful to override and modify the sitewide search block to search only eCommerce product titles and return only products. Here is a good way to achieve that:

First, you need override your search block (copy the search block directory from the core and place a copy of it into your override block directory in the site root) and make some modifications to the controller.php file.

Within the:

function do_search()

find the following:

      if (isset($_REQUEST['query'])) {

and modify it like so:

      if (isset($_REQUEST['query'])) {

Note: You need to make sure your products are set to have their own pages in order for this to work.

There you go! Now your search only looks through product names and returns only product pages.

Loading Conversation