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();
$address->setCountryId($country)->setPostcode($zipcode)->setCollectShippingrates(true);
$rates = $address->collectShippingRates()->getGroupedAllShippingRates();
foreach ($rates as $carrier) {
foreach ($carrier as $rate) {
print_r($rate->getData());
}
}
where i put this code in magento kindly guide me please
ReplyDeleteI 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
ReplyDeletemagento development company in bangalore