Skip to content
Documentation sections
English
Integrations

How to add smart search to OpenCart

Add Indexa search to your OpenCart theme header so it is available throughout your store.

Prepare the catalog and code

  1. Connect your product feed in Indexa and wait for the catalog to load.

  2. In “Widget → Integration”, enter the website URL and copy the universal code.

Through the theme editor

  1. Open “Design → Theme Editor”, if your store provides this editor.

  2. Select the store, active theme and common/header template. Back up the original code.

  3. Add the complete Indexa script before the closing </head> tag.

  4. Save the changes, enable any required template override and clear the theme cache.

If you edit theme files

In OpenCart 3, the header is commonly at catalog/view/theme/THEME_NAME/template/common/header.twig; in OpenCart 4, at catalog/view/template/common/header.twig. Theme extensions can use other paths.

Use a global head-code field provided by your theme, or ask your site maintainer to add the script to the correct header template.

Platform documentation: OpenCart 3 header template

Example for header.twig

Add the script to the existing template. Do not replace the complete header with this fragment.

Fragment of common/header.twig
<head>
  <!-- Existing store header code -->
  <script async src="INDEXA_LOADER_URL_FROM_DASHBOARD"></script>
</head>
Twig / HTML

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.

For multiple stores, select the correct store and check search on its domain after installation.

Still have questions? Contact us — We will help you set it up.

Esc — close