Public Member Functions | |
beforeSave ($object) | |
afterSave ($object) |
Definition at line 34 of file Shipping.php.
afterSave | ( | $ | object | ) |
post_index set in customer save action for address this is $_POST array index for address
Reimplemented from Mage_Eav_Model_Entity_Attribute_Backend_Abstract.
Definition at line 44 of file Shipping.php.
00045 { 00046 if ($defaultShipping = $object->getDefaultShipping()) 00047 { 00048 $addressId = false; 00049 /** 00050 * post_index set in customer save action for address 00051 * this is $_POST array index for address 00052 */ 00053 foreach ($object->getAddresses() as $address) { 00054 if ($address->getPostIndex() == $defaultShipping) { 00055 $addressId = $address->getId(); 00056 } 00057 } 00058 00059 if ($addressId) { 00060 $object->setDefaultShipping($addressId); 00061 $this->getAttribute()->getEntity() 00062 ->saveAttribute($object, $this->getAttribute()->getAttributeCode()); 00063 } 00064 } 00065 }
beforeSave | ( | $ | object | ) |
Reimplemented from Mage_Eav_Model_Entity_Attribute_Backend_Abstract.
Definition at line 36 of file Shipping.php.
00037 { 00038 $defaultShipping = $object->getDefaultShipping(); 00039 if (is_null($defaultShipping)) { 00040 $object->unsetDefaultShipping(); 00041 } 00042 }