How to add smart search to Drupal Commerce
Add Indexa search to Drupal Commerce using the shared HTML template of your Drupal theme.
Prepare the catalog and code
Connect your product feed in Indexa and wait for the catalog to load.
In “Widget → Integration”, enter the website URL and copy the universal code.
Add the search code to Drupal Commerce
If your theme or a module provides a global head-code field, use it.
Otherwise, ask your maintainer to add the complete script before </head> in html.html.twig in your custom theme.
Back up the file and retain Drupal's existing placeholders and theme code. Do not replace the complete template with this fragment.
Apply the changes to the active theme and clear the Drupal cache.
Example for html.html.twig
<head>
<!-- Existing Drupal theme code and placeholders -->
<script async src="INDEXA_LOADER_URL_FROM_DASHBOARD"></script>
</head>
Check search after installation
Open your store, then use “Check installation” in Indexa. Select the desktop and mobile search elements and save.
Search for a product, follow its link and close the widget. Repeat on the home, category and product pages.
Drupal Commerce uses the Drupal site theme. Test search on product pages and after navigation, including dynamically updated pages.