How to Insert Custom HTML and raw JavaScript in PrestaShop easily?


If you are reading this article you might have thought of using raw HTML inside any PrestaShop hook or pages. If you have a website, you might need custom HTML injection in the PrestaShop for better appearance.

You may think of adding a table or an H1 tag to display anything for better customization. Also, you want to do some actions with the HTML contents. But usually in PrestaShop does not allow you to do this. To write a custom HTML and JS code you need to go to the theme folders and .tpl files which is very risky to change. Because it may hamper your contents in the front end panel. Also to know which file to edit is a big problem though you are a developer.

In visual composer, you can add your custom HTML and JS anywhere you want. You just need to select the hook or go to the page where you want it. Then select the element weather HTML or js you want.

Step 2 – Search ‘raw’


Once you add one of the elements, you will see an edit window with the option to insert your code into a markup supportive text-area. The code will be instantly rendered on the Frontend editor of the Visual Composer.

After that just put your desired code there. Done! You will see the output in the front. Here is an example of putting JS code.

So, think about the TIME and MONEY, you will be saving by including incredibly flexible and versatile Module to your library. You will do things with PrestaShop that you previously thought never possible, let alone how much time it would take a Dev team to create!

Leave a Comment

Your email address will not be published. Required fields are marked *

seventeen + 10 =