public function load() { $addressType = $this->getVar('filter/addressType'); $attrFilterArray = array(); $attrFilterArray['firstname'] = 'like'; $attrFilterArray['lastname'] = 'like'; $attrFilterArray['email'] = 'like'; $attrFilterArray['group'] = 'eq'; /* * Fixing date filter from and to */ if ($var = $this->getVar('filter/created_at/from')) { $this->setVar('filter/created_at/from', $var . ' 00:00:00'); } if ($var = $this->getVar('filter/created_at/to')) { $this->setVar('filter/created_at/to', $var . ' 23:59:59'); } $attrToDb = array('group' => 'group_id', 'customer_address/country' => 'customer_address/country_id'); // Added store filter if ($storeId = $this->getStoreId()) { $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); if ($websiteId) { $this->_filter[] = array('attribute' => 'website_id', 'eq' => $websiteId); } } parent::setFilter($attrFilterArray, $attrToDb); }
public function load() { $attrFilterArray = array(); $attrFilterArray['name'] = 'like'; $attrFilterArray['sku'] = 'like'; $attrFilterArray['type'] = 'eq'; $attrFilterArray['attribute_set'] = 'eq'; $attrFilterArray['visibility'] = 'eq'; $attrFilterArray['status'] = 'eq'; $attrFilterArray['price'] = 'fromTo'; $attrFilterArray['qty'] = 'fromTo'; $attrToDb = array('type' => 'type_id', 'attribute_set' => 'attribute_set_id'); parent::setFilter($attrFilterArray, $attrToDb); parent::load(); }
public function load() { $addressType = $this->getVar('filter/addressType'); if ($addressType == 'both') { $addressType = array('default_billing', 'default_shipping'); } $attrFilterArray = array(); $attrFilterArray['firstname'] = 'like'; $attrFilterArray['lastname'] = 'like'; $attrFilterArray['email'] = 'like'; $attrFilterArray['group'] = 'eq'; $attrFilterArray['customer_address/telephone'] = array('type' => 'like', 'bind' => $addressType); $attrFilterArray['customer_address/postcode'] = array('type' => 'like', 'bind' => $addressType); $attrFilterArray['customer_address/country'] = array('type' => 'eq', 'bind' => $addressType); $attrFilterArray['customer_address/region'] = array('type' => 'like', 'bind' => $addressType); $attrFilterArray['created_at'] = 'dateFromTo'; $attrToDb = array('group' => 'group_id', 'customer_address/country' => 'customer_address/country_id'); parent::setFilter($attrFilterArray, $attrToDb); parent::load(); }
/** * Retrieve not loaded collection * * @param string $entityType * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */ protected function _getCollectionForLoad($entityType) { $collection = parent::_getCollectionForLoad($entityType)->setStoreId($this->getStoreId())->addStoreFilter($this->getStoreId()); return $collection; }
public function load() { $addressType = $this->getVar('filter/adressType'); //error in key filter addressType if ($addressType == 'both') { $addressType = array('default_billing', 'default_shipping'); } $attrFilterArray = array(); $attrFilterArray['firstname'] = 'like'; $attrFilterArray['lastname'] = 'like'; $attrFilterArray['email'] = 'like'; $attrFilterArray['group'] = 'eq'; $attrFilterArray['customer_address/telephone'] = array('type' => 'like', 'bind' => $addressType); $attrFilterArray['customer_address/postcode'] = array('type' => 'like', 'bind' => $addressType); $attrFilterArray['customer_address/country'] = array('type' => 'eq', 'bind' => $addressType); $attrFilterArray['customer_address/region'] = array('type' => 'like', 'bind' => $addressType); $attrFilterArray['created_at'] = 'datetimeFromTo'; /* * Fixing date filter from and to */ if ($var = $this->getVar('filter/created_at/from')) { $this->setVar('filter/created_at/from', $var . ' 00:00:00'); } if ($var = $this->getVar('filter/created_at/to')) { $this->setVar('filter/created_at/to', $var . ' 23:59:59'); } $attrToDb = array('group' => 'group_id', 'customer_address/country' => 'customer_address/country_id'); // Added store filter if ($storeId = $this->getStoreId()) { $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); if ($websiteId) { $this->_filter[] = array('attribute' => 'website_id', 'eq' => $websiteId); } } parent::setFilter($attrFilterArray, $attrToDb); return parent::load(); }