Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Responsive Joomla Virtuemart Template - CoolMart (SKU# FLEX-00014)

TOPIC: Search module not searching whole site products

Search module not searching whole site products 9 years 5 months ago #11229

I have seen lots of posts about this and tried lots of the suggested fixes but this template doesnt have the same files and the other posts so i havent been able to achieve it.
Basically the search module doesnt search the whole site, i expect you are aware of a fix and dont need me to example this but i will to save time:

www.bluefrogtoys.co.uk/pocket-money-toys/search?keyword=gorilla&limitstart=0&option=com_virtuemart&view=category

this URL is a search for "gorilla" within the category "pocket money toys" and returns zero results.

but from the homepage :

www.bluefrogtoys.co.uk/component/virtuemart/search?keyword=gorilla&limitstart=0&option=com_virtuemart&view=category

returns the correct Gorilla products.

Can you advise me how to make it so that whatever page you are on you can find any product ?

many thanks
The topic has been locked.

Search module not searching whole site products 9 years 5 months ago #11238

Hi,

The PHP file to control the search module is located here:

/templates/flexible_coolmart/flexible/systems/joomla/layouts/mod_search/default.php

open that file and make sure the <FORM> action URL doesn't have the virtuemart_category_id query. IT should be like this:
<form id="searchbox-<?php echo $module->id; ?>" class="searchbox" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0'); ?>" method="get">

So the "search module" will search the keyword within the entire site always (instead just within the category you are currently browsing)

Regards.
The topic has been locked.

Search module not searching whole site products 9 years 5 months ago #11248

Makes sense but doesnt seem to work, this is the content of that file:
<?php
/**
* @package   flexible Theme Framework
* @author    Flexible Web Design http://www.flexiblewebdesign.com
* @copyright Copyright (C) Flexible Web Design  
* @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
 
// get application
$app = JFactory::getApplication();
 
// get flexible
$flexible = flexible::getInstance();
 
// get item id
$itemid = intval($params->get('set_itemid', 0));
 
?>
 
<form id="searchbox-<?php echo $module->id; ?>" class="searchbox" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0'); ?>" method="get">
 
    <input type="text" onfocus="if(this.value=='<?php echo JText::_('MOD_SEARCH_LABEL_TEXT'); ?>') this.value='';" onblur="if(this.value=='') this.value='<?php echo JText::_('MOD_SEARCH_LABEL_TEXT'); ?>';" value="<?php echo JText::_('MOD_SEARCH_LABEL_TEXT'); ?>" size="20" class="FlexibleInputbox" alt="<?php echo JText::_('MOD_SEARCH_LABEL_TEXT'); ?>" name="keyword">
 
	<button type="reset" value="Reset"></button>
	<input type="hidden" name="limitstart" value="0" />
		<input type="hidden" name="option" value="com_virtuemart" />
		<input type="hidden" name="view" value="category" />
 
</form>

thanks
The topic has been locked.

Search module not searching whole site products 9 years 5 months ago #11250

Hi,

Are you sure you have made the coding changes on that file and clear the "cache" ?
Because i don't see anything has changed on your website.

When i browse this URL:
www.bluefrogtoys.co.uk/pocket-money-toys/search?keyword=gorilla&limitstart=0&option=com_virtuemart&view=category

i am seeing this:

Attachment Pasted_Image_11_9_14__3_03_PM.png not found




I am guessing something is forcing the action URL to reflect the category SEF URL in it, which wasn't supposed to happen as you don't have the virtuemart_category_id parameter in the URL. (Weird!). But try this;

open this PHP file:
/templates/flexible_coolmart/flexible/systems/joomla/layouts/mod_search/default.php

and make the form tag like this below:
<form id="searchbox-<?php echo $module->id; ?>" class="searchbox" action="/component/virtuemart/search" method="get">

So, the FORM action URL will always be /component/virtuemart/search (which will let you to perform the "search" within the entire site all the time)

Regards
Support
Last Edit: 9 years 5 months ago by Support.
The topic has been locked.

Search module not searching whole site products 9 years 5 months ago #11255

Thanks that second fix works perfectly :-)
The topic has been locked.

Search module not searching whole site products 9 years 5 months ago #11270

i am glad everything works out as expected.

case solved. topic is closed.

regards.
The topic has been locked.
Time to create page: 0.150 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo