Question

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?

Was it helpful?

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.

OTHER TIPS

Upload your javascript to js folder

Use webdav bro and copy the HTTP URL like this one --> http://store-d17df.mybigcommerce.com/js/jquery.fitvids.js

or the big commerce way--> < script src="%%GLOBAL_TPL_PATH%%/js/common.js">

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top