Posts Tagged magento
Magento and jQuery, Sitting in a Tree…
… k-i-s-s-i-n-g. First comes love, then comes… oh who am I kidding! They don’t really like each other that much. That said, here is how to make them at least tolerate each other:
Integrating jQuery with Magento is not complicated but there are a number of gotchas.
In a nutshell you…
- Create a directory named “jquery” (really you could name it “gorgonzola” but why not be consistent, eh?) in Magento’s js folder and stick the current version of jQuery inside it
wherever-you-installed-it/js/jquery/jquery.js - Implement jQuery’s noconflict mode by putting the following at the very end (very, very end… not inside a function or something) of the jQuery code
jQuery.noConflict();
- Add a call to jquery in the page.xml file (located somewhere like
wherever-you-installed-it/app/design/frontend/default/blank/layout/page.xmlNote that this assumes you are using the “blank” theme in the “default” frontend)This bit goes with all of the other addJs bits but, and this is what took up an hour of my incredibly valuable time (an hour I could have spent playing Wii Sports, anyway), make sure you put it after all of the other javascript files. Not just after some of them… after all of them.
- To now make use of all of this go into
wherever-you-installed-it/app/design/frontend/default/blank/template/page/html/head.phtmland put your jquery code right there at the end of the code
Magento, MAMP and {{base_url}} Issues
Posted by Stuart in Troubleshooting on May 19, 2009
A local install of Magento may give you a warning to change {{base_url}} for security purposes. I believe this only applies to production environments but it is annoying nonetheless. To solve this, within your Magento admin section, go to System-> Configurations and select the ‘Web’ tab (it’s over on the left under the configuration sidebar). Open the “Unsecure” and “Secure” sections and where you see {{base_url}} (this will be in the Base URL fields of each section… ignore any that say {{unsecure_base_url}} and the like, they don’t matter here) put in your actual base url.
In MAMP you may have something like: http://localhost:8888/magento/ (don’t forget that last slash). This will solve the issue.





