Magento 1.7 – How to Get Requested Shipping Country in Cart Item Page

cartce-1.7.0.2shipping

How to get requested shipping country id of checkout/cart/shipping.phtml on cart item list page code/core/Mage/CatalogInventory/Model/Stock/item.php?

Best Answer

The country ID is saved in the quotes shipping address. Check the CartController estimatePostAction method, Here the post for shipping estimation is handled.

Try this

$country = Mage::getSingleton('checkout/cart')->getQuote()
             ->getShippingAddress()
             ->getCountryId();
Related Topic