VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: trevorellis on June 29, 2018, 12:56:00 PM

Title: How to search all products and NOT just products in a specific category
Post by: trevorellis on June 29, 2018, 12:56:00 PM
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?
Title: Re: How to search all products and NOT just products in a specific category
Post by: 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
Title: Re: How to search all products and NOT just products in a specific category
Post by: Studio 42 on June 29, 2018, 15:51:51 PM
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)
Title: Re: How to search all products and NOT just products in a specific category
Post by: trevorellis on July 03, 2018, 18:52:37 PM
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?
Title: Re: How to search all products and NOT just products in a specific category
Post by: Jumbo! on July 03, 2018, 19:53:13 PM
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.
Title: Re: How to search all products and NOT just products in a specific category
Post by: trevorellis on July 13, 2018, 17:08:24 PM
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?
Title: Re: How to search all products and NOT just products in a specific category
Post by: Studio 42 on July 13, 2018, 18:46:48 PM
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"/>
Title: Re: How to search all products and NOT just products in a specific category
Post by: trevorellis on July 16, 2018, 20:51:47 PM
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.
Title: Re: How to search all products and NOT just products in a specific category
Post by: Studio 42 on July 16, 2018, 21:33:16 PM
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 ?
Title: Re: How to search all products and NOT just products in a specific category
Post by: trevorellis on July 20, 2018, 00:39:20 AM
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.
Title: Re: How to search all products and NOT just products in a specific category
Post by: 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)
Title: Re: How to search all products and NOT just products in a specific category
Post by: Jörgen on July 20, 2018, 07:22:15 AM
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
Title: Re: How to search all products and NOT just products in a specific category
Post by: trevorellis on July 22, 2018, 16:28:51 PM
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.