integration_documentation:plugins:shopware_smart_did_you_mean

integration_documentation:plugins:shopware_smart_did_you_mean

Customize Smart Did-You-Mean in Shopware 5

Three conditions have to be met, to be able to activate Smart Did-You-Mean with the FINDOLOGIC Shopware Unified Plugin.

  • The FINDOLOGIC Shopware Unified Plugin (Version 7.3.0 or higher) has to be installed.
  • Smart Did-You-Mean has to be activated for the specific service.
  • Smart Did-You-Mean recommendations have to be provided by the API.

The Smart Did-You-Mean output can be customized by themes and text modules in the Shopware backend.

The plugin provides the file FinSearchUnified/Resources/views/frontend/search/fuzzy.tpl.

The Smart Did-You-Mean output must be tested before the feature is released, because the default implementation does not fit the design of individual themes. Create a file of the same name and folder structure in the theme to adapt a template.

Available variables in the template:

  • $finSmartDidYouMean ⇒ Only available if Smart Did-You-Mean suggestions exist.
  • $finSmartDidYouMean.type ⇒ Has one of the following values: did-you-mean, improved, corrected, forced.
  • $finSmartDidYouMean.alternative_query ⇒ Contains the alternative search term proposed by FINDOLOGIC.
  • $finSmartDidYouMean.original_query ⇒ If the type is “did-you-mean”, this variable is empty. In any other case, it is the original query.

The wordings of the Smart Did-You-Mean suggestions are stored by the plugin in the Shopware backend as snippets and can be adapted there.

Open Configuration ⇒ Snippets

Select Namespaces ⇒ frontend ⇒ search ⇒ fuzzy on the left side of the window.

The available snippets are displayed on the right.

All the building blocks which names begin with “frontend / search / fuzzy” are provided by FINDOLOGIC.

You will also find the template variables mentioned above here.

Select Settings ⇒ Caches/Performance ⇒ Caches/performance

Select the “Cache” tab

After updating or installing the plugin, we recommend to empty the following sections:

  • Shopware configuration
  • Template cache
  • Compile themes

If the templates are changed, empty the following section:

  • Compile themes

If the text modules are changed, empty the following sections:

  • Shopware configuration
  • Template cache