Using jQuery with Magento Including Protype, Scriptaculous etc...

Posted by Damodar Bashyal on May 03, 2009

 

How to use jQuery with Magento?

Download jQuery from jQuery site

Add this line to the bottom of jQuery.js

jQuery.noConflict();

Copy the file to the js/jquery folder|directory

In page.xml, add it to the list of js files as:

<action method="addJs"><script>jquery/jquery-1.2.6.noConflict.min.js</script></action>

or,

<action method="addItem"><type>js</type><name>jquery.js</name><params/></action>
How to use jQuery with magento now?

The below procedure is one way.

More»

Magento: How To Add A Static Block To A CMS Page

Posted by Damodar Bashyal on April 24, 2009

 

My another hunt on the google to find the process to add a static block to a cms page. After few search and filter, i found a post on a pratthost. It saved my a lot of my time and headache. The following post is taken from it, slightly modified.

Actually, there was nothing complicated about achieving this. Static blocks are a great way to divide up different types of data blocks to make updating content easier.

More»

how to use var_dump and print_r in magento

Posted by Damodar Bashyal on April 24, 2009

 

This one is crazy with magento because sometimes it works and sometimes it just shows blank page. Once it gave me a real hard time. Finally found solution somewhere.

//I just had to do was add 
->debug()

//on the object that i wanted to print as:
$obj->debug();

//e.g. if i had
$_cart = Mage::getModel('checkout/cart');

//to use print_r or var_dump, i needed to do
print_r($_cart->debug());

These are methods available for a product:

More»