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

VirtueMart Search Product issues

Started by alexanderflr, March 29, 2018, 11:46:25 AM

Previous topic - Next topic

alexanderflr

Hi,
Since one or two updates ago, my search function doesn't work properly anymore, if the user is searching from homepage without going in any category it's fine but if he goes in a category, tries to find a product that is in another category will not find. Even if the user is going back to the homepage, for example goes from category drinks to the homepage and tries to find something that is in snacks by using the search module and will show "You are here:  Home > hawkers > Ambient Drinks" So even if I was on homepage, somehow this search remembers the last category where I went in and search only in that one  :'(
I really need this to work searching in all categories not in the last accessed one or the active one and I have no idea how to fix this.
Checking the settings in VirtueMart Search Product I notice there is a setting "Search Filter Category" which is set to "No", tried to play with this but doesn't make a difference.

I'm using VirtueMart 3.2.12, Joomla! 3.8.6 Stable, PHP Version 7.0.27

Any help will be much appreciated. Thank you very much!

LE: Just had a look on a development version of my website with no updates and the search is working properly, the version of Virtuemart is 3.2.4 and joomla 3.8.2 so I think something happened with the updates between 3.2.4 - 3.2.12
VM 3.2.8, Joomla 3.8.3, PHP 7.0.26

Studio 42

Check your template overides, and your search module settings, some values changed, perhaps you need to update or modify yourself the module template override.

alexanderflr

#2
Hi,
I checked each file from search module one by one and are the same compared to the old ones from the development website that I was saying about. I don't know what to do next, I'm thinking to downgrade a few versions because was better.

LE: I think this is the update that creates me problems:
VirtueMart 3.2.8 - Bugfix Release
- Fixes for search options and display of search results
- Search plugin, added SKU (by Franz-Peter Scherer)

VM 3.2.8, Joomla 3.8.3, PHP 7.0.26

Studio 42

Compare the searh module and template overides, certainlly you need to modify it and the issue is solved.
You can check the module settings, you have new option about menu ID, this can be the problem too.

alexanderflr

Thank you Studio 42, great advice. Was something missing from the module overrider towards the end of the file. I will post here the solution and hopefully will help someone else.

The file is located here /templates/YOUR_TEMPLATE_NAME/html/mod_virtuemart_search and the name of the file is default.php

Towards the end of the file I had
</div>
<input type="hidden" name="limitstart" value="0" />
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="category" />
<?php if(!empty($set_Itemid)){
echo '<input type="hidden" name="Itemid" value="'.$set_Itemid.'" />';
?>


  </form>

And didn't work so I changed the code to

</div>
<input type="hidden" name="limitstart" value="0" />
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="category" />
<input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id?>"/>
<?php if(!empty($set_Itemid)){
echo '<input type="hidden" name="Itemid" value="'.$set_Itemid.'" />';
?>


  </form>


And is now working  8)
VM 3.2.8, Joomla 3.8.3, PHP 7.0.26