User Tools

Site Tools


Sidebar

magento_2:advanced_search

For more details see the Advanced Search for Magento 2 extension page.

Advanced Search for Magento 2

The plugin allows customers to promptly find necessary products. A searchbox is fitted with an informative quick search window. You can customize autocomplete popup display according to your goals and make search process easy-to-follow.

Advanced Search for Magento 2 extension is compatible with the built-in Magento EE Sorl & Elasticsearch.

General Settings

To configure the extension settings, go to Admin Panel → Stores → Configuration → Search Pro

Popup width (px) - Indicate the width of the autocomplete popup window to make it fit in with other page elements.

Min characters - Specify the minimal number of characters that customers should type in to trigger the search process. By default, the number is three.

Enable Redirect from 404 to Search Results - Enable the option to redirect customers to the store search results from the broken URL instead of the 404 Not Found page.See sample

Custom URL Key for Default Search Results Page - Enable to set SEO-friendly short URLs.

If you are using Varnish cache when utilizing the custom URL, than to reduce the system load you should include this URL into the Varnish cache exceptions. Please, go to vendor/magento/module-page-cache/etc and select the file with the .vcl extension (depending on your Varnish cache version) and find the following code:

if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") {
return (pass);
}

Here, you need to add the custom URL to exceptions in the IF clause. For example, for the search URL the code will be the following:

if (req.url ~ "/checkout" || req.url ~ "/catalogsearch" || req.url ~ "/search") {
return (pass);
}
The extension returns shorter URLs like example.com/search/shoes instead of default example.com/catalogsearch/results/q=shoes.

SEO key - specify the URL alias for the search results' page.

Enable Tabs on the Search Result Page - To enable tabs, that sort search results by Category, CMS, and Landing on the search results page, set to Yes.

A front-end sample of tabs:

Search Attributes

You can include any available product attributes in search algorithm. For each attribute, you can set a priority (weight).

If there is a color attribute with weight 10 and description attribute with weight 5, and the query is red, search results will be more visually relevant, because the algorithm will choose color attribute prior to the words in description.

NOTE: Recently, Amasty has launched the new Elastic Search for Magento 2 extension that offers a flexible work with a search query and extensive configuration of product attributes.

Recent Searches

Show on first click - Set the option to Yes to let customers see the Recent Searches block in the autocomplete popup once they click on the quick search field.

Title - Specify the title and position for Recent searches block.

Max Results - Set the maximal number of search results that will be displayed in the search autocomplete popup.

Display Recent Searches in a pop-up

Enabled - Enable the display of the Popular Searches block.

Categories

Enabled - Enable the option to let the extension search among category attributes and display the results in the autocomplete popup.

Specify Categories block title, position and the max number of displayed results.

Description Length - Specify the maximal number of characters for category names and descriptions that will be shown is the search popup.

CMS Pages

Enabled - Set to Yes to enable search on CMS pages and display search results in the autocomplete popup.

Max Results - Specify the Title, Position and the Max number of displayed results.

Specify the maximal number of characters for headings and descriptions that will be shown is the search popup.

Products

Enabled - Set to Yes to enable search in products and display search results in the autocomplete popup.

Max Results - Specify the title, position and the max number of displayed results.

Show Reviews - Enable reviews display in the autocomplete popup.

Enable 'Add to Cart' Button - Show Add to cart button in the popup.

Redirect to Product Page - Set to Yes to enable redirection in case there is only one search result available.

To go to a product page, when the extension returns only one result in a search pop-up, press Enter.

Show 'Out of Stock' Products Last - Enable a feature to place the out-of-stock items last in the search results.

To make this feature works properly with out-of-stock items being displayed correctly, please make sure that out-of-stock items' visibility is enabled.
  1. Go to Admin Panel > Stores > Configuration > Catalog > Inventory > Stock Options
  2. Navigate to a Display Out of Stock Products field > Uncheck Use system value and set to Yes.
Out-of-stock items displayed last in the search results, a sample.

Landing Pages

You can enable an advanced search by landing pages on your web store, if you have Amasty Landing pages for Magento 2 extension installed.

Search Landing Pages

Note, that in order to have this functionality performing properly, the Landing Pages for Magento 2 extension should be installed.

To display Landing Pages instead of the search results page, go to Admin Panel > Marketing > SEO & Search > Search Terms > Press Add New Search Term.

  • Input expected Search Query;
  • Specify the Store;
  • Redirect URL - input the URL of the landing page.

Brands

Enabled - Set to Yes to enable search by brands and to display a brand section in the search window pop-up.

Title - Input a name for the section in the search pop-up, where the brands' results will be displayed.

A brand sample section in the search pop-up:

Blog

Enabled - Set to Yes to enable search by blog pages and to display a blog section in the search window pop-up.

Title - Input a name for the section in the search pop-up, where the blog results will be displayed.

Custom Layout

Text - Choose the necessary color for each element of the autocomplete window.

Color Picker - Click on the field to display the color picker tool.

NOINDEX

To prevent search engines (Google, Bing, Yahoo, etc.) from needlessly indexing Magento catalog search results page(s) and advanced search results page(s) we added the code to app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml.

  • If this file does not yet exist in your custom theme you can create it and Magento will automatically include it.
  • If this file already exists in your custom theme then copy everything except the first line XML declaration and elements into your copy of local.xml.

Reindex Categories

To reindex categories for correct search results, go to System → Tools → Index Management

Frontend Samples

Display Add to cart and More products button example.

Apply the Magento 2 filter products by attribute option to speed up the shopping process.
Find out how to install the Advanced Search extension for Magento 2 via Composer.
magento_2/advanced_search.txt · Last modified: 2018/10/03 16:28 by panamarenka