Magento Themes and Magento Extensions

Using jQuery in Magento

Posted on October 2nd, 2012 | Posted by admin

At work we are developing a site for a client using the Magento software. This is my first time using it and I’m finding it fairly badass (and it’s free!). There is a lot to like about it, which we’ll probably talk about another time, but it uses Prototype for a JavaScript library. Now I’m sure Prototype is wonderful and all that, but I don’t know a lick of it. I’d rather just use the library I’ve known to come and love, jQuery. But Prototype and jQuery notoriously don’t get along. This is how to deal with that.

  1. The latest version of Magento comes with a somewhat outdated version of the effects file, which is part of the problem. Go get the latest version (1.8.2 right now). You may want to rename it with the version number at the end, like effects-1.8.1.js
  2. Upload the file to [Magento]/js/scriptaculous
  3. Open the file page.xml at [Magento]/app/design/frontend/default/default/layout/page.xml
  4. On about line 41, there will be a line like this:

Link to Canonical Product URLs

Posted on October 1st, 2012 | Posted by admin

A real quick one today.. when playing with any variation of the product models in Magento, it’s possible to get the product URL in different ways. By using the basic getProductUrl() method you’ll return the pre-rewrite controller path that the system uses:


$product->getUrlModel()->getUrl($product, array(‘_ignore_category’=>true))

The final methods wrapped in getUrl() will prefix the website base URL to the path and give you your canonical URL, complete with the rewrite.

Page 7 of 7« First...«34567