Skip to main content

Posts

get Active shipping methods and payment methods

Active Shipping methods $activeCarriers = Mage::getSingleton('shipping/config')->getActiveCarriers();             // $allCarriers = array();             foreach ($activeCarriers as $carrierCode => $carrierModel) {                 $allCarriers[$carrierCode] = array('value' =>  Mage::getStoreConfig('carriers/' . $carrierCode . '/title'), 'label' => Mage::getStoreConfig('carriers/' . $carrierCode . '/title')); Or ( $allCarriers[$carrierCode] = array('value' =>  $carrierCode,  'label' => Mage::getStoreConfig('carriers/' . $carrierCode . '/title'));             }             return $allCarriers; Active Payment methods $payments = Mage::getSingleton('payment/config')->getActiveMethods();             $payMethods = array();         ...

get product group names and attribute set name by loading attbute set id

get product group names and attribute set name by loading attbute set id $product = Mage::getModel('catalog/product')->load(16);        //attribute set model.         $model = Mage::getModel('eav/entity_attribute_set');        // product attribute set id.         $attributeSetId = $product->getAttributeSetId();         $attributeSet = $model->load($attributeSetId);          // This is attribute set name.         $attributeSetName = $attributeSet->getAttributeSetName(); $groups = Mage::getModel('eav/entity_attribute_group') ->getResourceCollection() ->setAttributeSetFilter($attributeSetId) ->setSortOrder() ->load(); foreach ($groups as $group)  echo $groupName          = $group->getAttributeGroupName(); }

order cancel from front end

if you want cancel order from front end create module like this app/etc/modules/<Namespace_Modulename>.xml <config>     <modules>         <Namespace_CustomerOrderCancel>             <active>true</active>             <codePool>community</codePool>             <depends>                 <Mage_Sales />             </depends>         </ Namespace _CustomerOrderCancel>     </modules> </config> app/community/Namespace/Modulename           ------controllers           -------etc           -------Helper if you want cancel button in history page (myorder) need override block file Mage_Sales_Block_Orde...