Google logo
4.9 on Google
Get a free Magento audit

Recommendations on page speed, accessibility issues, and real user experience data

Skip to main article

Did you mean? Search suggestions in Magento

Did you mean? Search suggestions in Magento
10 mins

Develo is a leading Magento agency and eCommerce web development company based in Birmingham, in the UK, serving clients globally since 2010.

By default, Magento doesn’t offer much to the user if they misspell words. As a simple fix for this you can use the PHP functions pspell to highlight to the users any basic misspellings for their search word.

Replace the following html in /template/catalogsearch/result.phtml

 

Did you mean?

 <a href="/catalogsearch/result/?q=<?php echo $poss[$i];?>"> , </a>

This is probably one of the quickest and most basic solution to this problem. I’ll be investigating better solutions shortly.

You may find that the psell library isn’t compiled along with your PHP extensions. If you’ve got the required permissions then the installation is fairly simple

Then restart apache

If you enjoyed this article, read the other Blogs from our Magento development agency or browse the site to see what else we do with Adobe Commerce, Magento audits and more.

Last updated: April 15, 2024

Want to learn more about our services or speak to us about a project?

Learn with us

Latest learning resources

Practical ideas, helpful platform tips, and smart strategies to help your eCommerce store thrive.