How to Add Custom Script to Zen-Cart

Do you have custom scripts needed to incorporate into your zen-cart store template, but not sure where to customize it?

Zen-cart has the built-in template over-ride system that lets your add your own template file without changing the default template. You can add the corresponding files to the relevant zen-cart template folder, and the changes will override the default values.

If you wish to add javascript code to the site header tags, you can add the custom code to the html_header.php and place it to your template folder. Default template location is this:


If you need to add the script before </body> tag, you can make the modifed tpl_main.php from source and then put the file in the template custom folder.

The above will apply the code on site-wide basis. For custom script on specific pages, you will need to create the page folder just like custom template for containing the modified php file.

For instance, a folder called checkout_shipping in /templates/your_template/templates/ will be like this: /templates/your_template/templates/checkout_shipping/

Make sure you use the original file before you make modifications.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Filed under Zen-Cart #