<h1 align="center">
<a href="https://prompts.chat">
[](https://github.com/Amadeco/magento2-popular-search-terms/releases)
Sign in to like and favorite skills
A Magento 2 module that enhances the search experience by displaying popular search terms and personal search history. Optimizes product discovery and conversion rates by suggesting relevant terms based on both collective and individual user behaviors, all configurable from the admin and with no performance impact thanks to intelligent caching.
This professional module for Magento 2 enhances the search experience by combining two powerful features:
composer require amadeco/module-popular-search-terms bin/magento module:enable Amadeco_PopularSearchTerms bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
app/code/Amadeco/PopularSearchTerms/bin/magento module:enable Amadeco_PopularSearchTerms bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:clean
The module can be extensively customized via layout XML:
<referenceContainer name="sidebar.additional"> <block class="Amadeco\PopularSearchTerms\Block\SearchTerms" name="amadeco.search.terms" ifconfig="catalog/popular_search_terms/enabled"> <arguments> <!-- Recent searches configuration --> <argument name="max_recent_searches" xsi:type="number">5</argument> <!-- Form selectors configuration --> <argument name="search_form_id" xsi:type="string">search_mini_form</argument> <argument name="search_input_name" xsi:type="string">q</argument> <argument name="storage_key" xsi:type="string">recent-searches</argument> <!-- JS Layout configuration --> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="search-terms" xsi:type="array"> <item name="component" xsi:type="string">Amadeco_PopularSearchTerms/js/search-terms</item> <item name="config" xsi:type="array"> <item name="template" xsi:type="string">Amadeco_PopularSearchTerms/search-terms-template</item> <item name="hasRecentSearches" xsi:type="boolean">true</item> </item> </item> </item> </argument> </arguments> </block> </referenceContainer>
You can add the module to any custom location using XML layout or with PHP:
<?php echo $block->getLayout() ->createBlock('Amadeco\PopularSearchTerms\Block\SearchTerms') ->setMaxRecentSearches(3) ->toHtml(); ?>
The module includes LESS styles that can be overridden in your theme. The main styles are defined in:
view/frontend/web/css/source/_module.less
The module includes complete translations for:
To add additional translations, create a CSV file in:
app/code/Amadeco/PopularSearchTerms/i18n/your_locale.csv
This module is licensed under the Open Software License ("OSL") v3.0. See the LICENSE.txt file for details.
If you encounter any issues or have questions, please open an issue on GitHub.
Contributions are welcome! Please feel free to submit a Pull Request.