Thanks for your tip.
What i am doing for adding jquery is this:
1. In the root folder of magento installation there is folder js, in it i create another folder called jquery.
2. In root/js/jquery i put the jquery library and another javascript file jquery_functions.js cause from page.xml i see that it is using that folder name space to add the javascripts.
3. Make folder in app/design/frontend/default/ to represent your new theme, i call mine zoran and in it i create 3 folders (template, layouts and locale).
4. I copy the app/design/frontend/default/default/layouts/page.xml to app/design/frontend/default/zoran/layouts/page.xml. Just make sure you turn on this theme from the admin panel (with cache disabled)... How themes are organized, the page.xml will be loaded from the zoran folder cause it is higher in the hierarchy of the themes.
5. Add
in the head section, cause this part is loaded on every page of magento it will add the jquery library and the jquery_functions.js files.
To test it, open jquery_functions.js and add this code:
var jq = jQuery.noConflict();
jq(document).ready(function()
{
alert('I am from jquery');
//or
//console.log('I am from from jquery');
});
Thanks for your tip.
What i am doing for adding jquery is this:
1. In the root folder of magento installation there is folder js, in it i create another folder called jquery.
2. In root/js/jquery i put the jquery library and another javascript file jquery_functions.js cause from page.xml i see that it is using that folder name space to add the javascripts.
3. Make folder in app/design/frontend/default/ to represent your new theme, i call mine zoran and in it i create 3 folders (template, layouts and locale).
4. I copy the app/design/frontend/default/default/layouts/page.xml to app/design/frontend/default/zoran/layouts/page.xml. Just make sure you turn on this theme from the admin panel (with cache disabled)... How themes are organized, the page.xml will be loaded from the zoran folder cause it is higher in the hierarchy of the themes.
5. Add
after
mage/cookies.js
in the head section, cause this part is loaded on every page of magento it will add the jquery library and the jquery_functions.js files.
To test it, open jquery_functions.js and add this code:
var jq = jQuery.noConflict(); jq(document).ready(function() { alert('I am from jquery'); //or //console.log('I am from from jquery'); });Go to the frontend home page and refresh.