protected function _prepareCollection() { $_205d95c001c842f933e3b55fa4e902d5d2fdd0af = Mage::getModel('sublogin/budget')->getCollection(); $_205d95c001c842f933e3b55fa4e902d5d2fdd0af->getSelect()->join(array('sublogin' => $_205d95c001c842f933e3b55fa4e902d5d2fdd0af->getTable('sublogin/sublogin')), 'main_table.sublogin_id = sublogin.id', array('sublogin.email')); $this->setCollection($_205d95c001c842f933e3b55fa4e902d5d2fdd0af); return parent::_prepareCollection(); }
/** * Setting collection to show * * @return Mage_Adminhtml_Block_Widget_Grid */ protected function _prepareCollection() { $collection = Mage::getModel('xmlconnect/queue')->getCollection(); $collection->addFieldToFilter('main_table.status', array('neq' => Mage_XmlConnect_Model_Queue::STATUS_DELETED)); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $model = Mage::getModel('review/review'); $collection = $model->getProductCollection(); if ($this->getProductId() || $this->getRequest()->getParam('productId', false)) { $productId = $this->getProductId(); if (!$productId) { $productId = $this->getRequest()->getParam('productId'); } $this->setProductId($productId); $collection->addEntityFilter($this->getProductId()); } if ($this->getCustomerId() || $this->getRequest()->getParam('customerId', false)) { $customerId = $this->getCustomerId(); if (!$customerId) { $customerId = $this->getRequest()->getParam('customerId'); } $this->setCustomerId($customerId); $collection->addCustomerFilter($this->getCustomerId()); } if (Mage::registry('usePendingFilter') === true) { $collection->addStatusFilter($model->getPendingStatus()); } $collection->addStoreData(); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { //TODO: add full name logic $collection = Mage::getResourceModel('reports/customer_collection')->addAttributeToSelect('firstname')->addAttributeToSelect('lastname'); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getResourceModel('api/role_collection'); $collection->setRolesFilter(); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { //TODO: add full name logic $collection = Mage::getResourceModel('sales/order_collection')->addAttributeToSelect('increment_id')->addAttributeToSelect('created_at')->addAttributeToSelect('grand_total')->addAttributeToSelect('order_currency_code')->addAttributeToSelect('store_id')->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')->addExpressionAttributeToSelect('billing_name', 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})', array('billing_firstname', 'billing_lastname'))->addExpressionAttributeToSelect('shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})', array('shipping_firstname', 'shipping_lastname'))->addAttributeToFilter('customer_id', Mage::registry('current_customer')->getEntityId()); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getModel('enterprise_giftregistry/item')->getCollection()->addRegistryFilter($this->getEntity()->getId()); $collection->updateItemAttributes(); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getModel('firstdatae4/recurring')->getCollection(); $this->setCollection($collection); parent::_prepareCollection(); return $this; }
protected function _prepareCollection() { //TODO: add full name logic $collection = AO::getResourceModel('sales/order_Creditmemo_collection')->addAttributeToSelect('increment_id')->addAttributeToSelect('created_at')->addAttributeToSelect('order_currency_code')->addAttributeToSelect('store_currency_code')->addAttributeToSelect('base_currency_code')->addAttributeToSelect('state')->addAttributeToSelect('grand_total')->addAttributeToSelect('base_grand_total')->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')->addExpressionAttributeToSelect('billing_name', 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})', array('billing_firstname', 'billing_lastname'))->setOrderFilter($this->getOrder()); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $store = $this->getRequest()->getParam('store'); $collection = Mage::getModel('webforms/fieldsets')->setStoreId($store)->getCollection()->addFilter('webform_id', $this->getRequest()->getParam('id')); $this->setCollection($collection); return parent::_prepareCollection(); }
/** * Preparation of the data that is displayed by the grid. * * @return $this */ protected function _prepareCollection() { /** @var Mage_Cron_Model_Resource_Schedule_Collection $collection */ $collection = Mage::getModel('cron/schedule')->getCollection(); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { // Get collection //---------------------------- $collection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('name'); //---------------------------- //---------------------------- $collection->getSelect()->distinct(); //---------------------------- // Set filter store //---------------------------- $store = Mage::app()->getStore((int) $this->listing->getData('store_id')); if ($store->getId()) { $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', NULL, 'inner', $store->getId()); $collection->joinAttribute('thumbnail', 'catalog_product/thumbnail', 'entity_id', NULL, 'left', $store->getId()); } else { $collection->addAttributeToSelect('thumbnail'); } //---------------------------- //------------------------------ $productAddIds = (array) json_decode($this->listing->getData('product_add_ids'), true); $collection->joinTable(array('lp' => 'M2ePro/Listing_Product'), 'product_id=entity_id', array('id' => 'id'), '{{table}}.listing_id=' . (int) $this->listing->getId()); $collection->joinTable(array('elp' => 'M2ePro/Ebay_Listing_Product'), 'listing_product_id=id', array('listing_product_id' => 'listing_product_id')); $collection->getSelect()->where('lp.id IN (?)', $productAddIds); //------------------------------ // exit($collection->getSelect()->__toString()); // Set collection to grid $this->setCollection($collection); parent::_prepareCollection(); return $this; }
protected function _prepareCollection() { $role = Mage::getSingleton('aitpermissions/role'); $collection = Mage::getResourceModel('reports/quote_collection'); if (version_compare(Mage::getVersion(), '1.6.0.0', '<')) { $collection->prepareForProductsInCarts()->setSelectCountSqlType(Mage_Reports_Model_Mysql4_Quote_Collection::SELECT_COUNT_SQL_TYPE_CART); } else { $collection->prepareForProductsInCarts()->setSelectCountSqlType(Mage_Reports_Model_Resource_Quote_Collection::SELECT_COUNT_SQL_TYPE_CART); } if ($role->isPermissionsEnabled()) { if (!Mage::helper('aitpermissions')->isShowingAllProducts()) { if ($role->isScopeStore()) { $collection->getSelect()->joinLeft(array('product_cat' => Mage::getSingleton('core/resource')->getTableName('catalog_category_product')), 'product_cat.product_id = e.entity_id', array()); $collection->getSelect()->where(' product_cat.category_id in (' . join(',', $role->getAllowedCategoryIds()) . ') or product_cat.category_id IS NULL '); $collection->getSelect()->distinct(true); } if ($role->isScopeWebsite()) { $collection->addStoreFilter($role->getAllowedStoreviewIds()); } } } $this->setCollection($collection); return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getModel('affiliateplus/transaction')->getCollection(); $collection->getSelect()->where('coupon_code = \'\' OR coupon_code IS NULL'); $this->setCollection($collection); return parent::_prepareCollection(); }
/** * Get collection from commission table * * Return array of data to with seller commission information * * @return array */ protected function _prepareCollection() { $gid = Mage::helper('marketplace')->getGroupId(); $collection = Mage::getResourceModel('customer/customer_collection')->addNameToSelect()->addAttributeToSelect('email')->addAttributeToSelect('created_at')->addAttributeToSelect('group_id')->addFieldToFilter('group_id', $gid); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = AO::getResourceModel('reports/product_collection'); $collection->getEntity()->setStore(0); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getModel('core/website')->getCollection()->joinGroupAndStore(); $this->setCollection($collection); parent::_prepareCollection(); return $this; }
protected function _prepareCollection() { $collection = Mage::getResourceModel('Mage_Tag_Model_Resource_Reports_Customer_Collection'); $collection->addStatusFilter(Mage_Tag_Model_Tag::STATUS_APPROVED)->addGroupByCustomer()->addTagedCount(); $this->setCollection($collection); return parent::_prepareCollection(); }
/** * Charge la collection * * @return unknown */ protected function _prepareCollection() { //Charge la collection $collection = Mage::getModel('Purchase/StockMovement')->getCollection()->join('Purchase/CatalogProduct', 'sm_product_id=`Purchase/CatalogProduct`.entity_id')->join('Purchase/CatalogProductVarchar', 'sm_product_id=`Purchase/CatalogProductVarchar`.entity_id and store_id=0 and attribute_id = ' . mage::getModel('Purchase/Constant')->GetProductNameAttributeId()); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getResourceModel('reports/tag_product_collection'); $collection->addTagedCount()->addProductFilter($this->getRequest()->getParam('id'))->addStatusFilter(Mage::getModel('tag/tag')->getApprovedStatus())->addStoresVisibility()->setActiveFilter()->addGroupByTag()->setRelationId(); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $slider = $this->_getSlider(); $collection = Mage::getModel('revslider/slide')->getCollection()->addSliderFilter($slider && $slider->getId() ? $slider : 0); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::helper('M2ePro/Component_Amazon')->getCollection('Order'); $collection->getSelect()->joinLeft(array('so' => Mage::getSingleton('core/resource')->getTableName('sales/order')), '(so.entity_id = `main_table`.magento_order_id)', array('magento_order_num' => 'increment_id')); // Add Filter By Account //------------------------------ if ($accountId = $this->getRequest()->getParam('amazonAccount')) { $collection->addFieldToFilter('`main_table`.account_id', $accountId); } //------------------------------ // Add Filter By Marketplace //------------------------------ if ($marketplaceId = $this->getRequest()->getParam('amazonMarketplace')) { $collection->addFieldToFilter('`main_table`.marketplace_id', $marketplaceId); } //------------------------------ // Add Not Created Magento Orders Filter //------------------------------ if ($this->getRequest()->getParam('not_created_only')) { $collection->addFieldToFilter('magento_order_id', array('null' => true)); } //------------------------------ $this->setCollection($collection); return parent::_prepareCollection(); }
/** * Prepare grid collection object * * @return Mage_Adminhtml_Block_System_Variable_Grid */ protected function _prepareCollection() { /* @var $collection Mage_Core_Model_Mysql4_Variable_Collection */ $collection = Mage::getModel('core/variable')->getCollection(); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getResourceModel('reports/tag_product_collection'); $collection->addUniqueTagedCount()->addAllTagedCount()->addStatusFilter(Mage::getModel('tag/tag')->getApprovedStatus())->addGroupByProduct(); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $store = $this->_getStore(); $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('sku')->addAttributeToSelect('name')->addAttributeToSelect('attribute_set_id')->addAttributeToSelect('type_id'); if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) { $collection->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left'); } if ($store->getId()) { //$collection->setStoreId($store->getId()); $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID; $collection->addStoreFilter($store); $collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore); $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId()); $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId()); $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId()); $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId()); } else { $collection->addAttributeToSelect('price'); $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner'); $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner'); } $this->setCollection($collection); parent::_prepareCollection(); $this->getCollection()->addWebsiteNamesToResult(); return $this; }
protected function _prepareCollection() { $collection = Mage::helper('M2ePro/Component_Ebay')->getCollection('Order_Item')->addFieldToFilter('order_id', $this->order->getId()); $collection->getSelect()->joinLeft(array('cisi' => Mage::getSingleton('core/resource')->getTableName('cataloginventory_stock_item')), '(cisi.product_id = `main_table`.product_id AND cisi.stock_id = 1)', array('is_in_stock')); $this->setCollection($collection); return parent::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getResourceModel('googlebase/type_collection')->addItemsCount(); $this->setCollection($collection); parent::_prepareCollection(); return $this; }
protected function _prepareCollection() { // take a look at Mage_Adminhtml_Model_Extension_Collection_Abstract $collection = AO::getSingleton('adminhtml/extension_collection'); $this->setCollection($collection); return parent::_prepareCollection(); }
/** * Prepare related orders collection * * @return Mage_Adminhtml_Block_Widget_Grid */ protected function _prepareCollection() { $collection = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Grid_Collection'); $collection->addBillingAgreementsFilter(Mage::registry('current_billing_agreement')->getId()); $this->setCollection($collection); return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection(); }
protected function _prepareCollection() { $collection = Mage::getModel('affiliate/affiliatebinaryresidual')->getCollection(); $collection->getSelect()->order(array('main_table.start_date DESC', 'paid DESC', 'customer_id ASC')); $this->setCollection($collection); return parent::_prepareCollection(); }