コード例 #1
0
 /**
  * Determine if the address has already been validated.
  * Based upon:
  * - The address object having a 'has_been_validated' property which is true
  * - Matches the 'validated_address' object stashed in the session
  * @param Mage_Customer_Model_Address_Abstract
  * @return bool
  */
 protected function _hasAddressBeenValidated(Mage_Customer_Model_Address_Abstract $address)
 {
     // flag set on addresses that are returned from the Address Validation response
     if ($address->getHasBeenValidated()) {
         return true;
     }
     // when the address is used as a shipping address, must ensure that the validated
     // address was validated as a shipping address
     if ($this->_isAddressUsedForShipping($address)) {
         $validatedAddress = $this->getValidatedAddress(Mage_Customer_Model_Address::TYPE_SHIPPING);
     } else {
         $validatedAddress = $this->getValidatedAddress($address->getAddressType());
     }
     // ensure - a validated address of this type exists
     // it was actually validated/validation wasn't skipped
     // and it matches the current address
     return $validatedAddress && $this->_compareAddressToValidatedAddress($address, $validatedAddress);
 }