public function __construct() { parent::__construct(); if (Mage::getStoreConfig('amcustomerattr/general/select_grid')) { $this->_attributeCollection = Mage::getModel('customer/attribute')->getCollection(); $this->_attributeCollection->addFieldToFilter('is_user_defined', 1); // 'is_filterable_in_search' used to setting "Show on Manage Customers Grid" $this->_attributeCollection->addFieldToFilter('is_filterable_in_search', 1); $this->_attributeCollection->addFieldToFilter('entity_type_id', Mage::getModel('eav/entity')->setType('customer')->getTypeId()); $this->_attributeCollection->getSelect()->order('sorting_order'); } }
public function __construct() { parent::__construct(); if (Mage::getStoreConfig('amcustomerattr/general/select_grid')) { $this->_attributeCollection = Mage::getModel('customer/attribute')->getCollection(); $filters = array("is_user_defined = 1", "entity_type_id = " . Mage::getModel("eav/entity")->setType("customer")->getTypeId()); $this->_attributeCollection = Mage::helper('amcustomerattr')->addFilters($this->_attributeCollection, 'eav_attribute', $filters); $filters = array("is_filterable_in_search = 1"); $sorting = 'sorting_order'; $this->_attributeCollection = Mage::helper('amcustomerattr')->addFilters($this->_attributeCollection, 'customer_eav_attribute', $filters, $sorting); } }