Skip to main content

How to Install AddSearch on a PrestaShop Website

AddSearch provides an instant search solution that returns results immediately and integrates easily with your website. This guide explains how to add AddSearch search functionality to your PrestaShop site.

Step 1: Obtain Your Site Key

  1. Log in to your AddSearch account.
  2. Navigate to Setup > Keys and installation.
  3. Copy your Site key from the provided section.

Step 2: Customize and Copy the Search Widget Script

  1. Open the AddSearch Search Designer tool.
  2. Configure the search widget appearance and behavior as needed.
  3. Copy the generated installation script.

Example installation script snippet (replace YOUR_SITE_KEY with your actual key):

<script>
(function() {
var cx = 'YOUR_SITE_KEY';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cdn.addsearch.com/js/widget.js?sitekey=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
</script>
<addsearch-widget></addsearch-widget>

Step 3: Insert the Script into Your PrestaShop Theme

You need to add the copied script into the PrestaShop template where you want the search field to appear, typically on the homepage.

  1. Locate your active theme folder (usually under /themes/your-theme/).
  2. Edit the index.tpl file to add the script in the desired location, for example, near the top of the homepage.
  3. Paste the entire script snippet you copied from the Search Designer into this file.
  4. Save your changes.

PrestaShop template edit example Example of inserting script into the index.tpl file.

Step 4: Test the Search Field

  1. Open your website homepage.
  2. Type a letter into the new search box to verify that AddSearch returns instant results.

AddSearch search box on PrestaShop AddSearch instant search integrated on the PrestaShop homepage.

You have successfully integrated AddSearch on your PrestaShop site. Adjust widget settings anytime through the Search Designer tool to fit your needs.