Search code examples
javascriptbigcommerce

Add a Javascript File to BigCommerce Template


I am attempting to add a javascript file to a BigCommerce template that will enable a function needed. I am not familiar with BigCommerce but was contracted to add this functionality.

How do I add a javascript file to a BigCommerce template?

I tried create a custom folder like so:

/template/_custom/my-javascript-file.js

but when I insert that file path into the template it throws a 404 error IE:

<script type="text/javascript" src="/template/_custom/my-javascript-file.js"></script>

How do I add an external javascript file to a BigCommerce Template?


Solution

  • First you need to upload your JavaScript file via WebDav. I would add it to /templates/js. If this folder doesn't exist, create it.

    The file path would be:

    <script type="text/javascript " src="/templates/__custom/is/my-javascript-file.is"></script>

    Note that __custom does not actually exist in the folder structure.