Page 1 of 1

Mod Virtuemart Ajax Search pro

PostPosted: Mon Nov 10, 2025 1:46 pm
by spike1968
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

Re: Mod Virtuemart Ajax Search pro

PostPosted: Mon Nov 10, 2025 3:41 pm
by spike1968
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.