Author Topic: VirtueMart Search Product issues  (Read 1525 times)

alexanderflr

  • Beginner
  • *
  • Posts: 47
  • VirtueMart Version: 3.2.8
VirtueMart Search Product issues
« on: March 29, 2018, 11:46:25 am »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3531
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: VirtueMart Search Product issues
« Reply #1 on: April 01, 2018, 00:23:11 am »
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

  • Beginner
  • *
  • Posts: 47
  • VirtueMart Version: 3.2.8
Re: VirtueMart Search Product issues
« Reply #2 on: April 17, 2018, 12:55:09 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3531
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: VirtueMart Search Product issues
« Reply #3 on: April 17, 2018, 21:33:09 pm »
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

  • Beginner
  • *
  • Posts: 47
  • VirtueMart Version: 3.2.8
Re: VirtueMart Search Product issues
« Reply #4 on: April 18, 2018, 16:58:28 pm »
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
Code: [Select]
</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

Code: [Select]
</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