Created
July 19, 2012 13:11
-
-
Save IvanChepurnyi/3143810 to your computer and use it in GitHub Desktop.
Any reason for using collection to retrieve single address instead of using load method of model?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php | |
/** | |
* Edit order address form | |
*/ | |
public function addressAction() | |
{ | |
$addressId = $this->getRequest()->getParam('address_id'); | |
$address = Mage::getModel('sales/order_address') | |
->getCollection() | |
->addFilter('entity_id', $addressId) | |
->getItemById($addressId); | |
if ($address) { | |
Mage::register('order_address', $address); | |
$this->loadLayout(); | |
// Do not display VAT validation button on edit order address form | |
$addressFormContainer = $this->getLayout()->getBlock('sales_order_address.form.container'); | |
if ($addressFormContainer) { | |
$addressFormContainer->getChild('form')->setDisplayVatValidationButton(false); | |
} | |
$this->renderLayout(); | |
} else { | |
$this->_redirect('*/*/'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Has been fixed in Mage+ apparently mageplus/mageplus@b4332cd