For example, you want to add specific jQuery plugin (myscript.carousel.min.js).
The tutorial is actual for CS-Cart and Multi-Vendor 4.x
1. Make sure that the status of the My changes add-on is Active ( Add-ons -> Manage Add-ons )
2. Put the myscript.carousel.min.js file to the CSCART_DIR/js/addons/my_changes directory 3. Create the CSCART_DIR/design/themes/[your theme]/templates/addons/my_changes/hooks/index/scripts.post.tpl file with the following content
4. Clear the cache ( Administration > Storage > Clear cache) 5. Check the result
See also: - [url="http://forum.cs-cart.com/topic/37510-how-to-add-custom-css-with-my-changes-addon/"]How To Add Custom Css With My Changes Addon[/url]
- [url="http://forum.cs-cart.com/topic/38177-how-to-add-a-new-carrier/"]How To Add A New Carrier[/url]
You don't need to clear storage cache for custom JS, however the way he described it you do indeed need to clear the cache, because the scripts.post.tpl needs to be reloaded in order for the new "myscript.js" to be loaded.
You don't need to clear storage cache for custom JS, however the way he described it you do indeed need to clear the cache, because the scripts.post.tpl needs to be reloaded in order for the new "myscript.js" to be loaded.
You can always try. The compiled js file should be recreated to include new js file. So we ask you to clear the cache
I just tried this, but it didn't work. I cleared the cache, too.
The one thing I didn't have before is a "js" folder inside my theme folder. I had to create that, then create the addons and my_changes folders inside that.
That was the only part that wasn't really apart of the steps up top. Thoughts?
js folder is in the root of your store. If you want to put JS in a different location, then you must ensure that your smarty script tag references the new location. Generally addon js scripts should go in js/addons/[addon name]/nameofyourscript.js
I just tried this, but it didn't work. I cleared the cache, too.
The one thing I didn't have before is a "js" folder inside my theme folder. I had to create that, then create the addons and my_changes folders inside that.
That was the only part that wasn't really apart of the steps up top. Thoughts?
tbirnseth is right. I have corrected the instruction. Hope this will help you.
Then you probably have a conflict between variable/function names that it uses and ones used in cs-cart or other included JS. Does your browser console inspector shed any light?