diff --git a/app/code/community/IntegerNet/Autoshipping/Model/Observer.php b/app/code/community/IntegerNet/Autoshipping/Model/Observer.php index a1b26ee..e4bb6ac 100644 --- a/app/code/community/IntegerNet/Autoshipping/Model/Observer.php +++ b/app/code/community/IntegerNet/Autoshipping/Model/Observer.php @@ -40,13 +40,16 @@ public function prepareShippingAddress(Varien_Event_Observer $observer) } $shippingAddress = $quote->getShippingAddress(); - $shippingAddress->setCountryId($country); + if ($this->_getCoreSession()->getCountryIsManuallyChangedInCart() || !$shippingAddress->getCountryId()) { + $shippingAddress->setCountryId($country); + } if (!$shippingAddress->getFreeMethodWeight()) { $shippingAddress->setFreeMethodWeight($shippingAddress->getWeight()); } $this->_methodManuallyChanged = $this->_isMethodManuallyChanged($shippingAddress); + $this->_getCoreSession()->setCountryIsManuallyChangedInCart(false); } /** * Set shipping method diff --git a/app/code/community/IntegerNet/Autoshipping/controllers/CountryController.php b/app/code/community/IntegerNet/Autoshipping/controllers/CountryController.php index 6857daa..878a635 100644 --- a/app/code/community/IntegerNet/Autoshipping/controllers/CountryController.php +++ b/app/code/community/IntegerNet/Autoshipping/controllers/CountryController.php @@ -13,7 +13,7 @@ class IntegerNet_Autoshipping_CountryController extends Mage_Core_Controller_Fro public function selectAction() { $countryId = $this->getRequest()->getParam('country_id'); - Mage::getSingleton('core/session')->setAutoShippingCountry($countryId); + Mage::getSingleton('core/session')->setAutoShippingCountry($countryId)->setCountryIsManuallyChangedInCart(true); $this->_redirectReferer(); } -} \ No newline at end of file +}