/** * Set the passed in address object to ignore validation only when * we are currently saving an order and ROM Address validation is not * needed. * * @param Mage_Customer_Model_Address_Abstract * @return self */ public function allowAddressValidation(Mage_Customer_Model_Address_Abstract $address) { /** @var Mage_Core_Controller_Request_Http */ $request = $this->app->getRequest(); /** @var bool */ $needValidation = $this->validator->shouldValidateAddress($address); // We only want to ignore address validation when we are actually creating an order. // The assumption is if we get to this point, then, validating the address is // unnecessary if it is already valid in ROM. if (!$needValidation && $request->getActionName() === 'saveOrder') { $address->setShouldIgnoreValidation(true); } return $this; }
/** * Get the address object for the original address submitted to the service. * * @return Mage_Customer_Model_Address */ public function getOriginalAddress() { return $this->_validator->getOriginalAddress(); }