Magento : How to get all active payment methods and shipping methods

Bellow chunk of code will get you all active payment methodes,

$payments = Mage::getSingleton('payment/config')->getActiveMethods();
$payMethods = array();
foreach ($payments as $paymentCode=>$paymentModel) 
{
    $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
    $payMethods[$paymentCode] = $paymentTitle;
}
return $payMethods;

This code will returns all active shipping methods,

$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
$shipMethods = array();
foreach ($methods as $shippigCode=>$shippingModel) 
{
    $shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
    $shipMethods[$shippigCode] = $shippingTitle;
}
return $shipMethods;

2 thoughts on “Magento : How to get all active payment methods and shipping methods

  1. Pingback: Magento : How to get all active payment methods and shipping methods | Kenneth Carnesi

  2. Como y donde debo de ingresar esta code, adicional esto corrigiera un problema que no se porque no se muestra los módulos de ( system / Payment Methods ) del frontend no se muetra, en todo caso dadme la raiz del folder a insertar y linea de copy.
    Gracias por su respuesta

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s