Follow by Email

Wednesday, May 21, 2014

How to get all available shipping carrier rate by zip code and country code in Magento

If you have country code and zip code then you can find out the all available shipping carrier rate by following code in magento.

$zipcode = '711101';
$country = 'IN';                    
$cart = Mage::getSingleton('checkout/cart');
$address = $cart->getQuote()->getShippingAddress();

$rates = $address->collectShippingRates()->getGroupedAllShippingRates();

foreach ($rates as $carrier) {
             foreach ($carrier as $rate) {


  1. where i put this code in magento kindly guide me please

  2. I do agree with all the ideas you have presented in your post. They’re really convincing and will certainly work. Still, the posts are very short for newbies. Could you please extend them a little from next time?..Keep this great work
    magento development company in bangalore