How to add quantity field on catalog / product listing page

I just managed to find some time to write a small module which will help you if you want to add quantity text box on your catalog / product listing page. As lot of users were asking about it, so I thought it would be very good to share it with other users. So, let’s do it step by step: St

[ read more ]

How to run magnto outside platform and get product collection query

Yesterday I was trying to find out that how to run magento outside platform and found out very nice little code  and also how you can get the query of product collection or any other table using the following code: <?php getCollection(); $collection->addAttributeToSelect('status'); $c

[ read more ]

How to override sales block and model

I was just working on the Sales module to override block and model classes. I though it would be very good to share it with others as well. So, here it is and let’s do it step by step: Step 1: Create new module in local folder with your preferred name, in my case I am going to keep it

[ read more ]

How to add attribute to ALL attribute sets

Most of the time I face a problem to add a attribute to all attribute sets...Which is very time consuming job. So, I wrote a little script which can help you a lot to add a attribute to all attribute sets immediately, just run the following sql command and you are done :) INSERT INTO

[ read more ]

Get All Products Of An Order

$order = Mage::getModel('sales/order')->load($order_id); $items = $order->getAllItems(); $itemcount=count($items); $name=array(); $unitPrice=array(); $sku=array(); $ids=array(); $qty=array(); foreach ($items as $itemId => $item) { $name[] = $item->getName(); $unitPrice[]=$

[ read more ]

Custom Account/Registration Fields

http://www.magentocommerce.com/wiki/custom_account/registration_fields

[ read more ]

How to get currency symbol?

Here’s another way that might work for you: Mage::app()->getLocale()->currency(Mage::app()->getStore()-> getCurrentCurrencyCode())->getSymbol() or if you want to pass a certain currency code simply specify it: Mage::app()->getLocale()->currency('EUR')->getSymbol()

[ read more ]

How to add new db field where you can store values seperated by commas?

It took me some time to find out that how to do it :) But believe me it was really easy, here you go: Suppose if you are calling the following method in your controller: $brands = Mage::getModel('brands/brands')->setData($data); it means that you are calling the the brands.php in brands module

[ read more ]

Get current url

This is a doozy but useful. Get the current URL anywhere in phtml or php files by using the core/url helper method. $current_url = $this->helper('core/url')->getCurrentUrl();

[ read more ]

How to add resource urls to CMS pages

Inside of magento cms pages {{store direct_url=media}} The given code snippet will produce http://www.example.com/media Outside of magento cms pages {{store direct_url=media/store/cms/brands/brand_logo.gif}} The given code snippet will produce http://www.example.com/media/store/cms/bran

[ read more ]