|
@@ 286-290 (lines=5) @@
|
| 283 |
|
*/ |
| 284 |
|
public function shouldValidateAddress(Mage_Customer_Model_Address_Abstract $address) |
| 285 |
|
{ |
| 286 |
|
if ($this->_hasAddressBeenValidated($address)) { |
| 287 |
|
$logMessage = 'No validation - already validated'; |
| 288 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 289 |
|
return false; |
| 290 |
|
} |
| 291 |
|
if ($this->_isCheckoutAddress($address)) { |
| 292 |
|
if ($this->_isAddressFromAddressBook($address)) { |
| 293 |
|
$logMessage = 'No validation - from address book'; |
|
@@ 292-296 (lines=5) @@
|
| 289 |
|
return false; |
| 290 |
|
} |
| 291 |
|
if ($this->_isCheckoutAddress($address)) { |
| 292 |
|
if ($this->_isAddressFromAddressBook($address)) { |
| 293 |
|
$logMessage = 'No validation - from address book'; |
| 294 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 295 |
|
return false; |
| 296 |
|
} |
| 297 |
|
if ($this->_isAddressBeingSaved()) { |
| 298 |
|
$logMessage = 'Require validation - saving address in address book'; |
| 299 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
|
@@ 297-301 (lines=5) @@
|
| 294 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 295 |
|
return false; |
| 296 |
|
} |
| 297 |
|
if ($this->_isAddressBeingSaved()) { |
| 298 |
|
$logMessage = 'Require validation - saving address in address book'; |
| 299 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 300 |
|
return true; |
| 301 |
|
} |
| 302 |
|
if ($this->_isVirtualOrder()) { |
| 303 |
|
$logMessage = 'No validation - virtual order'; |
| 304 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
|
@@ 302-306 (lines=5) @@
|
| 299 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 300 |
|
return true; |
| 301 |
|
} |
| 302 |
|
if ($this->_isVirtualOrder()) { |
| 303 |
|
$logMessage = 'No validation - virtual order'; |
| 304 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 305 |
|
return false; |
| 306 |
|
} |
| 307 |
|
if ($this->_isAddressBillingOnly($address)) { |
| 308 |
|
$logMessage = 'No validation - billing only'; |
| 309 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
|
@@ 307-311 (lines=5) @@
|
| 304 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 305 |
|
return false; |
| 306 |
|
} |
| 307 |
|
if ($this->_isAddressBillingOnly($address)) { |
| 308 |
|
$logMessage = 'No validation - billing only'; |
| 309 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 310 |
|
return false; |
| 311 |
|
} |
| 312 |
|
if ($this->_isMissingRequiredFields($address)) { |
| 313 |
|
$logMessage = 'No validation - missing required fields'; |
| 314 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
|
@@ 312-316 (lines=5) @@
|
| 309 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 310 |
|
return false; |
| 311 |
|
} |
| 312 |
|
if ($this->_isMissingRequiredFields($address)) { |
| 313 |
|
$logMessage = 'No validation - missing required fields'; |
| 314 |
|
$this->_logger->debug($logMessage, $this->_context->getMetaData(__CLASS__)); |
| 315 |
|
return false; |
| 316 |
|
} |
| 317 |
|
} |
| 318 |
|
return true; |
| 319 |
|
} |