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
- Log in to your AddSearch account.
- Navigate to Setup > Keys and installation.
- Copy your Site key from the provided section.
Step 2: Customize and Copy the Search Widget Script
- Open the AddSearch Search Designer tool.
- Configure the search widget appearance and behavior as needed.
- 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.
- Locate your active theme folder (usually under
/themes/your-theme/). - Edit the
index.tplfile to add the script in the desired location, for example, near the top of the homepage. - Paste the entire script snippet you copied from the Search Designer into this file.
- Save your changes.
Example of inserting script into the
index.tplfile.
Step 4: Test the Search Field
- Open your website homepage.
- Type a letter into the new search box to verify that AddSearch returns instant results.
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.
Example of inserting script into the
AddSearch instant search integrated on the PrestaShop homepage.