2013 June

Get all attributes from an attribute set in magento.

$entityTypeId = Mage::getModel(‘eav/entity’)->setType(‘catalog_product’)->getTypeId();$attributeSetName = ‘Default’; //Edit with your required Attribute Set Name$attributeSetId = Mage::getModel(‘eav/entity_attribute_set’)->getCollection()->setEntityTypeFilter($entityTypeId)->addFieldToFilter(‘attribute_set_name’, $attributeSetName)->getFirstItem()->getAttributeSetId();$attributesInfo = Mage::getResourceModel(‘eav/entity_attribute_collection’)->setEntityTypeFilter($attributeSetId) //4 = product…

Create custom event in magento.

Use below 2 magneto event to dispatch event in magento <controller_action_predispatch><observers><pioc_backoffice_shipping_observer><class>PIOC_Backoffice_Model_Shipping_Observer</class><method>hookToControllerActionPreDispatch</method></pioc_backoffice_shipping_observer></observers></controller_action_predispatch> <controller_action_postdispatch><observers><pioc_backoffice_shipping_observer><class>PIOC_Backoffice_Model_Shipping_Observer</class><method>hookToControllerActionPostDispatch</method></pioc_backoffice_shipping_observer></observers></controller_action_postdispatch> The below are 2 custom event that we…

Convert Magento Database to Innodb

ALTER TABLE `admin_assert` ENGINE=InnoDB;ALTER TABLE `admin_role` ENGINE=InnoDB;ALTER TABLE `admin_rule` ENGINE=InnoDB;ALTER TABLE `admin_user` ENGINE=InnoDB;ALTER TABLE `adminnotification_inbox` ENGINE=InnoDB;ALTER TABLE `api_assert` ENGINE=InnoDB;ALTER TABLE…

Different kind of catalog sorting (top selling,top rated, new products, special products) in magento

//////////////////////////////////// template/catalog/product/list/toolbar.phtml <div class=”demoTarget toolbar”> <span class=”pagingTotal”>Order:</span> <?php /*?><select onchange=”setLocation(this.value)” id=”default-usage-selectdate”> <?php foreach($this->getAvailableOrders() as $_key=>$_order): ?> <option value=”<?php echo $this->getOrderUrl($_key,…

Related product is not coming, upsell product is coming by default

1)appdesignfrontenddefaultmagikjewellerylayoutcatalog.xml Change <block type=”catalog/product_list_upsell” name=”product.info.upsell” as=”upsell_products” template=”catalog/product/list/upsell.phtml”>                     <action method=”setColumnCount”><columns>4</columns></action>                     <action method=”setItemLimit”><type>upsell</type><limit>4</limit></action>                 </block> With <block type=”catalog/product_list_related” name=”product.info.related”  template=”catalog/product/list/related.phtml”…

1 4 5 6 8