示例#1
0
 /**
  * Sets up address data to the GiftRegistry entity  object
  *
  * @param Mage_Customer_Model_Address $address
  * @return $this
  */
 public function importAddress(Mage_Customer_Model_Address $address)
 {
     $skip = array('increment_id', 'entity_type_id', 'parent_id', 'entity_id', 'attribute_set_id');
     $data = array();
     $attributes = $address->getAttributes();
     foreach ($attributes as $attribute) {
         if (!in_array($attribute->getAttributeCode(), $skip)) {
             $data[$attribute->getAttributeCode()] = $address->getData($attribute->getAttributeCode());
         }
     }
     $this->setData('shipping_address', serialize($data));
     return $this;
 }