Using JavaScript code in theme files

If you want to add a custom JavaScript code to your mini-site or merchant/affiliate panel, it can be added to the theme files of your custom theme. JavaScript code can be added only in the files with the extension .stpl. Also, the code must be enclosed within the literal tags. See our guide on how to add a FlowHunt chatbot as an example.

{literal}
  <script>
    alert('Hello, World!')
  </script>
{/literal}

Usage of a JavaScript code in .tpl theme files is not allowed, although if you need to execute a script even in a .tpl file, you can add your script via an iframe, or through a hidden HTML image with an onload attribute, calling a JavaScript function defined e.g. in footer.stpl.

×