How to convert an array to a collection object in magento?

Scenario Suppose say we have an array of data fetched from database. And we want to merge it with Magento collection object or want to provide the data as collection object to the view(template) file. Solution <?php $resource = Mage::getModel(‘core/resource’); $connection = $resource->getConnection(‘core_read’); $sql = "SELECT * FROM custom_table WHERE some_field = ?"; $rows = …

Read moreHow to convert an array to a collection object in magento?

Playing with Attribute Set in Magento

Introduction An attribute set is a collection of attributes which can be created/edited from Catalog -> Manage Attribute Sets in backend. Some useful snippets regarding Attribute Set. 1> Getting Attribute Set Details $attributeSetModel = Mage::getModel(‘eav/entity_attribute_set’); $attributeSetId = 9; // or $_product->getAttributeSetId(); if you are using product model $attributeSetModel->load($attributeSetId); print_r($attributeSetModel->getData()); 2> Getting Attribute Set Id by …

Read morePlaying with Attribute Set in Magento