I'm creating a CS-Cart v4.10
addon.
I want to execute some Javascript code from inside the scripts.post.tpl
template hook. I figured this hook out from taking a look at other addons, because actually there is no explanation about how to put Javascript in addons in the official docs.
This hook works fine for other addons, but not for mine. There is no output in the console, and actually my code is not included in the page nor the compiled scripts.
I have read about the my_changes
addon but since I'm actually creating an addon, it doesn't seems a good idea to me to use that way.
The Javascript code is a simple:
console.log('Got executed!');
and I'm putting that single line in the file:
~\cscart\design\backend\templates\addons\a_test_cscart_addon\hooks\addons\scripts.post.tpl
I have also seen people talking about script.tpl
and even scripts_head.tpl
or similar, but still don't know how to get my single liner executed without using the my_changes
addon.
Thanks for your time and help.