Support > Installation Guides > How do I install Store Locator Widgets on Prestashop

How do I install Store Locator Widgets on Prestashop

1. Click here to get your embed code, highlight it and copy it to your clipboard.

2. First, you need to edit one of the Prestashop source files as explained in this forum answer: https://www.prestashop.com/forums/topic/273632-solved-cant-add-an-iframe-in-cms-page-155/?do=findComment&comment=1372223. The reason for this is that the page editor blocks the addition of scripts without this change being made which means that third party scripts such as ours cannot be installed. Don't worry, this only takes a minute or two to achieve!

Here's how to do it:

1. Find your prestashop installation folder on the web server and open his file: /prestashop/classes/Validate.php

2. Comment out this line:

        if (preg_match('/<[s]*script/ims', $html) || preg_match('/('.$events.')[s]*=/ims', $html) || preg_match('/.*script:/ims', $html)) {
            return false;
        }

By replacing the above text with:

        /*
        if (preg_match('/<[s]*script/ims', $html) || preg_match('/('.$events.')[s]*=/ims', $html) || preg_match('/.*script:/ims', $html)) {
            return false;
        }
        */

Alternatively, you can just replace your existing Validate.php with the patched copy of this file which you can find here. Rename the existing file /prestashop/classes/Validate.php /prestashop/classes/Validate.old then download this file and rename it to Validate.php and paste it into the same  folder.

Once you have added the store locator installation code you can revert back to the original Validate.php file if you like, it's up to you.

3. Click on Design -> Pages and Add new page.

4. When adding the Page Content, ensure you press the <> button to select HTML mode and paste in our embed code.

That's it, you're done!