Tag Archives: collection model

Magento status and created_at grid view issues

Have you ever tried to change the Magento Grid View collections to a custom selects and joins?

For example you want your Invoice Grid to take some columns from the Order table:

 

Continue reading Magento status and created_at grid view issues

Magento join – EAV and Flat table

Case 1: After the Magento join, we want to have a EAV Collection as a result collection

//the ‘1’ is just a example of a where clause, you can totally miss this part, if you do not need it :)


$collection = Mage::getModel('catalog/product_link')
                    ->useRelatedLinks()
                    ->getProductCollection()
                    ->joinTable('sales/order_item',
                                'product_id=entity_id',
                                array('*'),
                                'entity_id=1',
                                'left');

Continue reading Magento join – EAV and Flat table