Author Topic: How to search all products and NOT just products in a specific category  (Read 1806 times)

trevorellis

  • Beginner
  • *
  • Posts: 24
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.14
I'm using the Virtuemart extension with the JA Megastore template. Currently when I go to the 'Shop' page (http://avaloncharm.co.uk/index.php/shop) and search it will search all the products, which is what I want (http://avaloncharm.co.uk/index.php/shop?keyword=bag&search=true&view=category&option=com_virtuemart&virtuemart_category_id=0). However, when I am on specific category (e.g. 'Bags' - http://avaloncharm.co.uk/index.php/shop/bags) and then search for a product that is not in that category (e.g. Owl Quilt - http://avaloncharm.co.uk/index.php/shop?keyword=owl+quilt&search=true&view=category&option=com_virtuemart&virtuemart_category_id=2) it will not find it. How can I get it so that the search will find all the products no matter what subpage of the 'Shop' I am using? I will be very thankful for any help. I have been informed by other sources that I need to disable Search Filter Category. However, I am unsure where to do this as going into Extensions>VM - Search In Shop and disabling it does absolutely nothing. Is there a line of code I can put into the custom.css?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27479
  • Always on vacation
    • Jenkin Hill Internet
Open the VirtueMart Search Product moduloe in the Joomla backend to see the search configuration,  and deselect Search Filter Category
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.3.10057 on Joomla 3.9.10 PHP 7.0.33
Testing VM 3.5.0.10097 on Joomla 3.9.10

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3957
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Another solution is to add a checkbox "search in all the shop" so customer can search in category or whole shop(Of course this feature do not exist in core but only need an override)

trevorellis

  • Beginner
  • *
  • Posts: 24
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.14
Open the VirtueMart Search Product moduloe in the Joomla backend to see the search configuration,  and deselect Search Filter Category

I had already gone into Extensions>Modules and gone on the VM -Search In Shop and deselected Search Filter Category but it made no difference whatsoever. Is there something else I need to do or is there somewhere else I can change this?

Jumbo!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 669
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always latest
Do you have any other instance of the search module in the site? Probably you are changing the settings in a wrong instance. Go to ExtensionsModules and filter module list by type "VirtueMart Search Products". Trash all instances which are not in use and change the settings only in the correct one. Clear cache of your site after changing the settings. Now check again.

trevorellis

  • Beginner
  • *
  • Posts: 24
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.14
I have removed all instances of the searchbar modules and cleared the cache of the website. However, the searchbar on the site still has the same problem. What can I do to fix this? Is it possibly a Virtuemart installation error/glitch?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3957
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
try to check in the JOOMLAROOT/modules/mod_virtuemart_search/tmpl/default.php to remove the action
<form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0&virtuemart_category_id='.$category_id ); ?>" method="get">
<form action="" method="get">
or
Code: [Select]
<input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id?>"/>to
Code: [Select]
<input type="hidden" name="virtuemart_category_id" value="0"/>

trevorellis

  • Beginner
  • *
  • Posts: 24
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.14
I went into that file (Joomlaroot/modules/mod_virtuemart_search/tmpl/default.php) and I could not find the action <form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0&virtuemart_category_id='.$category_id ); ?>" method="get">
<form action="" method="get">

However, I did change <input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/> to <input type="hidden" name="virtuemart_category_id" value="0"/> and it has made no difference.

What else can I do? Please help.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3957
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
I see this in the file :
<!--BEGIN Search Box -->
<form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0&virtuemart_category_id='.$category_id ); ?>" method="get">

Do you have updated your virtuemart AIO pack ?

trevorellis

  • Beginner
  • *
  • Posts: 24
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.14
Okay I have found the code - <form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0&virtuemart_category_id='.$category_id ); ?>" method="get"> - and removed it but the problem persists. I have now tried removing - <input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/> - and on a separate occasion I left that code in but changed - <input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/> - to - <input type="hidden" name="virtuemart_category_id" value="0"/> - as you had suggested as an alternative. Neither solution appears to be working.

The Virtuemart version I have is 3.2.14. The Virtuemart AIO component is 3.2.12.9708. How do I check whether or not my Virtuemart AIO pack needs updating? Thanks in advance.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3957
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
I think we dont speak from same search.
YO mean the search inside the category view and i speak from search module.
You have to modify the JOOMLAROOT/components/com_virtuemart/category/tmpl/default.php view (or better do an ovveride in template)

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2286
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
The AIO pack should always be updated together with the VM component. Usually Joomla update info is telling You to update the AIO.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

trevorellis

  • Beginner
  • *
  • Posts: 24
  • A beginner
  • VirtueMart Version: VirtueMart 3.2.14
I think we dont speak from same search.
YO mean the search inside the category view and i speak from search module.
You have to modify the JOOMLAROOT/components/com_virtuemart/category/tmpl/default.php view (or better do an ovveride in template)

I believe doing the override has fixed it, thank you very much.