News:

Looking for documentation? Take a look on our wiki

Main Menu

How to search all products and NOT just products in a specific category

Started by trevorellis, June 29, 2018, 12:56:00 PM

Previous topic - Next topic

trevorellis

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

Open the VirtueMart Search Product moduloe in the Joomla backend to see the search configuration,  and deselect Search Filter Category
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

Studio 42

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

Quote from: jenkinhill on June 29, 2018, 15:03:43 PM
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!

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

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

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
<input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id?>"/>
to
<input type="hidden" name="virtuemart_category_id" value="0"/>

trevorellis

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

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

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

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

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.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

trevorellis

Quote from: Studio 42 on July 20, 2018, 02:51:38 AM
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.