News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

2.9.9e Search field always on top of the category page (solution included)

Started by balai, October 01, 2014, 12:13:37 PM

Previous topic - Next topic

balai

Hi

The search field is always on top of the category page no matter if the search module have been used.
This could be bad in case we would like to use a 3rd party search module or just hide it for aesthetic reasons.

The solution resides in the file: components\com_virtuemart\views\category\tmpl\default.php

in the lines 57-82 there is that code:

if (!empty($this->keyword)) {
?>
<h3><?php echo $this->keyword?></h3>
<?php
?>

<?php // if (!empty($this->keyword)) {

//$category_id  = vRequest::getInt ('virtuemart_category_id', 0); ?>

<form action="<?php echo JRoute::('index.php?option=com_virtuemart&view=category&limitstart=0'FALSE); ?>" method="get">

<!--BEGIN Search Box -->
<div class="virtuemart_search">
<?php echo $this->searchcustom ?>
<br/>
<?php echo $this->searchCustomValues ?>
<input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>"/>
<input type="submit" value="<?php echo vmText::('COM_VIRTUEMART_SEARCH'?>" class="button" onclick="this.form.keyword.focus();"/>
</div>
<input type="hidden" name="search" value="true"/>
<input type="hidden" name="view" value="category"/>
<input type="hidden" name="option" value="com_virtuemart"/>
<input type="hidden" name="virtuemart_category_id" value="<?php echo $this->categoryId?>"/>

</form>
<!-- End Search Box -->
<?php // } ?>


It has to be converted to:

if (!empty($this->keyword)) {?>
<h3><?php echo $this->keyword?></h3>

<form action="<?php echo JRoute::('index.php?option=com_virtuemart&view=category&limitstart=0'FALSE); ?>" method="get">

<!--BEGIN Search Box -->
<div class="virtuemart_search">
<?php echo $this->searchcustom ?>
<br/>
<?php echo $this->searchCustomValues ?>
<input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>"/>
<input type="submit" value="<?php echo vmText::('COM_VIRTUEMART_SEARCH'?>" class="button" onclick="this.form.keyword.focus();"/>
</div>
<input type="hidden" name="search" value="true"/>
<input type="hidden" name="view" value="category"/>
<input type="hidden" name="option" value="com_virtuemart"/>
<input type="hidden" name="virtuemart_category_id" value="<?php echo $this->categoryId?>"/>

</form>
<!-- End Search Box -->
<?php  ?>


tested and works