コード例 #1
0
 /**
  * Transfer data from a Magento customer address to a ROM SDK
  * PhysicalAddress payload.
  *
  * @param Mage_Customer_Model_Address_Abstract
  * @param IPhysicalAddress
  * @return IPhysicalAddress
  */
 public function customerAddressToPhysicalAddressPayload(Mage_Customer_Model_Address_Abstract $address, IPhysicalAddress $payload)
 {
     return $payload->setLines($address->getStreetFull())->setCity($address->getCity())->setMainDivision($address->getRegionId())->setCountryCode($address->getCountryId())->setPostalCode($address->getPostcode());
 }
コード例 #2
0
 /**
  * Extract only the data from the addres that gets validated.
  * The extracted data can be compared to the data in an existing
  * @param Mage_Customer_Model_Address_Abstract $address
  * @return Mage_Customer_Model_Address_Abstract - an address object containing only the data that gets validated
  */
 protected function _extractValidatedAddressData(Mage_Customer_Model_Address_Abstract $address)
 {
     $validatedAddress = Mage::getModel('customer/address')->setData(['street' => $address->getData('street'), 'city' => $address->getCity(), 'region_id' => $address->getRegionId(), 'country_id' => $address->getCountryId(), 'postcode' => $address->getPostcode(), 'address_type' => $address->getAddressType()]);
     return $validatedAddress;
 }