示例#1
0
 protected function _isAttributeOmitted($attribute)
 {
     $res = parent::_isAttributeOmitted($attribute);
     if (!Mage::app()->getStore()->isAdmin() && $attribute->getIsUserDefined() && $attribute->getEntityTypeId() == Mage::getModel('eav/entity')->setType('customer')->getTypeId()) {
         // will skip all user-defined (created with the extension) attributes, to avoid errors on checkout for registered customer
         $res = true;
     }
     $storeAttribute = $attribute->getStoreIds();
     if ($storeAttribute) {
         $customer = Mage::getModel('customer/customer');
         $customerId = Mage::app()->getRequest()->getParam('id');
         if ($customerId) {
             $customer->load($customerId);
             $storeId = $customer->getStoreId();
             if (is_numeric($storeAttribute)) {
                 if ($storeId != $storeAttribute) {
                     $res = true;
                 }
             } else {
                 $res = true;
                 $storeAttribute = explode(',', $storeAttribute);
                 foreach ($storeAttribute as $attr) {
                     if ($attr == $storeId) {
                         $res = false;
                         break;
                     }
                 }
             }
         }
         // else { // if required error when save customer in backend
         //   $res = true;
         //}
     }
     return $res;
 }
示例#2
0
 protected function _isAttributeOmitted($attribute)
 {
     $res = parent::_isAttributeOmitted($attribute);
     if (!Mage::app()->getStore()->isAdmin() && $attribute->getIsUserDefined()) {
         // will skip all user-defined (created with the extension) attributes, to avoid errors on checkout for registered customer
         $res = true;
     }
     return $res;
 }