Skip to content
10+ installs
code
Helpers & fixes e5pscj v1.0.0

E5 PS Custom CSS & JS

Adds custom CSS and JavaScript to your PrestaShop 9 shop without editing the theme or using the database.

Small design fixes and tracking codes usually end up in theme files, and the next theme update deletes them. E5 PS Custom CSS & JS keeps that code in the admin panel: write your CSS, head JavaScript, footer JavaScript or DOM ready code, save, and it appears on the shop. The code is saved in a file outside the database, can be limited to selected pages and can be different for each shop in a multistore setup. Theme updates no longer touch it.

How it works

Custom CSS

Write CSS rules in the admin panel and they are printed in a style tag in the page head. Colors, spacing, hidden elements or a small layout fix: no child theme and no FTP needed.

JavaScript in the head and footer

Head JavaScript runs before the page content, for example for verification or tracking codes. Footer JavaScript is printed at the end of the page, right before the closing body tag, so it does not slow down the first render.

DOM ready code

Code that needs the page elements goes into the DOM ready field. The module wraps it in a DOMContentLoaded listener for you, so you only write the code itself.

Page targeting

Leave the page fields empty to print the code everywhere, or limit it to pages such as the home page, product pages, categories, cart or checkout. You can also exclude pages, for example keep a script away from the checkout.

Multistore

In a multistore setup, code saved under “All shops” is shared. Select a shop to give it its own code, or keep it on the shared code with one switch.

Outside the database

Code is saved in a JSON file in PrestaShop’s protected var folder, or in a folder you choose. A database restore does not overwrite it, the file can be backed up or versioned, and it stays in place when you reinstall the module.

Highlights

  • check_circle Code is kept in a file, not in the database
  • check_circle CSS and JS in the head, JS before the end of the page, DOM ready code
  • check_circle Only on selected pages, or everywhere except some
  • check_circle Shared code for all shops, or separate code per shop
  • check_circle English and Turkish admin, works on every PrestaShop 9 release

Technical details

A short technical summary for developers and system administrators.

Hooks
displayHeader for CSS and head JavaScript; displayBeforeBodyClosingTag (default) or displayFooter for footer and DOM ready JavaScript. No core or theme file is changed.
Storage
var/modules/e5pscj/snippets.json, or the folder in the E5PSCJ_STORAGE_DIR constant. Saves write a temporary file and rename it, so a failed save never leaves a half-written file. The file is read once per page.
File format
JSON with one entry for all shops and optional entries per shop ID. Each entry holds the code fields, the footer hook choice and the page lists.
Safety
Closing script and style tags inside your code are escaped. Only employees who can configure modules can change the code; the code itself runs as you wrote it.
Page names
PrestaShop page names such as index, product, category, cms, cart and order. Module pages use module-<module>-<controller>, for example module-ps_checkout-validate.
Language
The configuration page is in Turkish when the employee language is Turkish and in English otherwise.

Frequently asked questions

The questions we hear most about E5 PS Custom CSS & JS, answered.

What does E5 PS Custom CSS & JS do?

It adds the CSS and JavaScript you write in the admin panel to your shop pages: CSS and JS in the page head, JS at the end of the page and DOM ready code. You do not edit theme files.

Which PrestaShop versions does it support?

Every PrestaShop 9 release (9.0 and later 9.x versions), with PHP 8.1 or newer as PrestaShop 9 requires. PrestaShop 1.7 and 8 are not supported.

Do I add style or script tags?

No. Write only the code; the module adds the style and script tags. If your code contains a closing script or style tag, for example inside a string, it is escaped so it cannot break the page.

Where is my code saved?

In var/modules/e5pscj/snippets.json in your shop folder, which visitors cannot open. You can choose another folder with one line in config/defines_custom.inc.php; the module guide shows it.

Why does my code not run?

Check that “Print the snippets” is on and that the page fields do not exclude the page. If your shop or hosting sends a strict Content Security Policy, the browser may block inline code; the browser console shows that. Errors in your own JavaScript also appear in the console.

Can each shop have its own code?

Yes. Code saved under “All shops” is used by every shop. When you select a shop and turn off “Use the shared snippets”, that shop gets its own code, which replaces the shared code for it.

I used the older Custom Inline CSS & JS module. What should I do?

Install E5 PS Custom CSS & JS: it imports the code saved by the old module on install. Check the shop, then uninstall the old module so the code is not printed twice.

What happens if I uninstall it?

Your code is no longer printed on the shop, but the file stays where it is. If you install the module again, your code comes back.

Other plugins

price_change
5+ installs v1.0.0
Prices and currency e5psmcp

E5 PS Multi Currency Prices

PrestaShop 9 module that shows each product’s price in the currencies you choose, under the main price on the product page and in category, search and home page lists. Tax-included and tax-excluded prices, fixed rates such as EUR–BGN 1.95583, texts per language and an English and Turkish admin.

  • check Any number of currencies next to the main price, disabled ones included
  • check Fixed conversion rates, for example 1 EUR = 1.95583 BGN
  • check Separate positions for the product page and product lists
  • check Block title and tax labels in every shop language
  • check English and Turkish admin, works on every PrestaShop 9 release

Custom development

Let’s tailor this plugin to your site

We can extend E5 PS Custom CSS & JS for your site’s specific needs: a new feature, a different workflow, or an integration with another system you use. Tell us what you need and we will plan it with you. We only charge for the extra time we actually put in, and small 10–15 minute jobs are on us.