Mod Virtuemart Ajax Search pro

Please post your questions and problems with any of our extensions which you are using

Mod Virtuemart Ajax Search pro

Postby spike1968 » Mon Nov 10, 2025 1:46 pm

Hi,

I have a specific requirement to replace the word "cups" with "cup" in the search input. In other words if the user enters the word "cups" I want it to be replaced automatically by the search with "cup" so that the plural isn't searched.

I don't want to exclude plurals.

I think i Need to add

Code: Select all
$product_keyword = str_replace('cups','cup', $product_keyword);


into the module somewhere but I cannot seem to work out where.

I need the user inputted search term to work on ajax search and on enter press.

Can you point me in the right direction please.

Thanks
spike1968
 
Posts: 20
Joined: Thu Nov 24, 2016 10:14 am

Re: Mod Virtuemart Ajax Search pro

Postby spike1968 » Mon Nov 10, 2025 3:41 pm

Found what I was looking for

I added

Code: Select all
$keyword = str_replace('cups','cup', $keyword);


at line 80 of view.html.php in com_rupsearch > views > search

This isn't ideal as it means it will be overridden on every update, however its a solution for the moment.

If you have an alternative I could apply on override then that would be appreciated.

You could also add am options in search module to replace words to improve search. perhaps an option in "grammar config" as you have set for grammar mistaken letters.
spike1968
 
Posts: 20
Joined: Thu Nov 24, 2016 10:14 am


Return to VirtueMart and Joomla Extensions (free or paid)

cron