/**
  * Is specified address a default shipping address?
  *
  * @param Mage_Customer_Model_Address $address
  * @return bool
  */
 protected function _isDefaultShippingAddress(Mage_Customer_Model_Address $address)
 {
     return $address->getCustomer()->getDefaultShipping() == $address->getId();
 }
Example #2
0
 /**
  * Check whether specified shipping address is default for its customer
  *
  * @param Mage_Customer_Model_Address $address
  * @return bool
  */
 protected function _isDefaultShipping($address)
 {
     return $address->getId() && $address->getId() == $address->getCustomer()->getDefaultShipping() || $address->getIsPrimaryShipping() || $address->getIsDefaultShipping();
 }
Example #3
0
 /**
  * Import quote address data from customer address object
  *
  * @param   Mage_Customer_Model_Address $address
  * @return  Mage_Sales_Model_Quote_Address
  */
 public function importCustomerAddress(Mage_Customer_Model_Address $address)
 {
     $this->setCustomerAddressId($address->getId())->setCustomerId($address->getParentId())->setEmail($address->hasEmail() ? $address->getEmail() : $address->getCustomer()->getEmail())->setFirstname($address->getFirstname())->setLastname($address->getLastname())->setCompany($address->getCompany())->setStreet($address->getStreet())->setCity($address->getCity())->setRegion($address->getRegion())->setRegionId($address->getRegionId())->setPostcode($address->getPostcode())->setCountryId($address->getCountryId())->setTelephone($address->getTelephone())->setFax($address->getFax());
     return $this;
 }