Skip to main content

Posts

Showing posts from January, 2015

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();             foreach ($payments as $paymentCode => $paymentModel) {                 $payMethods[$paymentCode] = array('value' =&

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_Order_History.php app/community/Namespace/Modulename/etc/                                 ----config.xml                                 ----system.xml config.xml <?xml version="1.0"?> <!--/* @category   Namespace * @package     Namespace _CustomerOrderCancel