Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add/include js file into Magento theme

I am modifying a Magento theme. And want to add a js file into the theme /js folder. I have added the following code:

<action method="addItem"><type>skin_js</type><name>js/custom-script.js</name></action>

into the /app/design/frontend/theme-name/default/layout/page.xml and published the js file into /skin/frontend/theme-name/default/js/. But no luck. It is not showing on the page.

like image 305
psuparna Avatar asked Sep 29 '14 05:09

psuparna


1 Answers

Try adding the following to your layout .xml file within <reference name="head">

<action method="addJs">
    <script>js/custom-script.js</script>
</action>
like image 90
Sunil Kumar Avatar answered Oct 09 '22 15:10

Sunil Kumar