示例#1
0
 /**
  * Retrieve customer or customer address attribute instance
  *
  * @param string $attributeCode
  * @return Mage_Customer_Model_Attribute|false
  */
 protected function _getAttribute($attributeCode)
 {
     if ($this->getForceUseCustomerAttributes() || $this->getObject() instanceof Mage_Customer_Model_Customer) {
         return parent::_getAttribute($attributeCode);
     }
     $attribute = Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode);
     if ($this->getForceUseCustomerRequiredAttributes() && $attribute && !$attribute->getIsRequired()) {
         $customerAttribute = parent::_getAttribute($attributeCode);
         if ($customerAttribute && $customerAttribute->getIsRequired()) {
             $attribute = $customerAttribute;
         }
     }
     return $attribute;
 }
示例#2
0
 /**
  * Retrieve customer attribute instance
  *
  * @param string $attributeCode
  * @return Mage_Customer_Model_Attribute
  */
 protected function _getAttribute($attributeCode)
 {
     if (!$this->getObject() instanceof Mage_Customer_Model_Customer) {
         return Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode);
     }
     return parent::_getAttribute($attributeCode);
 }