Saturday, 6 July 2013

Hide list Catelogy on result Search page format

When we use Virtuemart_search module, list of catelogy will be showed before result list.
Some case, I want to hide this catelogy list and only show result list. This solution I found on internet.

In search module \modules\mod_virtuemart_search\tmpl\default.php  line 4 says:

Code:
<form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0&virtuemart_category_id='.$category_id )
The result of search is intended to be shown in category view. So, what do we have here? $category_id=0 (parent category!) and sub-categories on top of the default category view, then the list of products (if any), found in our search.

Temporary solution: if we don't need categories in category view, at least in our search result, check if it is a search request. Change line 72 in \components\com_virtuemart\views\category\tmpl\default.php from this:

Code: 
if(!empty($this->category->children)){
to this:

Code:
if(!empty($this->category->children ) && !(boolean)JRequest::getVar('search', false)){

This is my result


No comments:

Post a Comment