Did you mean? Search suggestions in Magento

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.

For more content about Magento check out our blog


...
Luke

share:

Ready to start your next project?

See how we can help you accelerate your business