public function __construct() { parent::__construct(); $customer_id = (int) Mage::getSingleton("customer/session")->getCustomer()->getId(); $invitations = Mage::getModel('affiliate/affiliateinvitation')->getCollection()->addFieldtoFilter('customer_id', $customer_id)->addFieldToFilter('status', array('in' => array(MW_Affiliate_Model_Statusinvitation::CLICKLINK, MW_Affiliate_Model_Statusinvitation::REGISTER, MW_Affiliate_Model_Statusinvitation::SUBSCRIBE, MW_Affiliate_Model_Statusinvitation::PURCHASE)))->setOrder('invitation_time', 'DESC'); $this->setInvitationHistory($invitations); }
/** * __construct Contructor that prepare the collection for assign product list * @var Int $userId Current logged seller id * @var String $filter Search query string * @var String $filter_prostatus product status query string * @var String filter_data_frm product creation from date query string * @var String filter_data_to product creation to date query string * @var Object $collection Catalog product collection object * @var Array $products Catalog product ids * @var Object $collection Assign product collection object */ public function __construct() { parent::__construct(); $userId = Mage::getSingleton('customer/session')->getCustomerId(); $filter = $this->getRequest()->getParam('s') != "" ? $this->getRequest()->getParam('s') : ""; $filter_prostatus = $this->getRequest()->getParam('prostatus') != "" ? $this->getRequest()->getParam('prostatus') : ""; $filter_data_frm = $this->getRequest()->getParam('from_date') != "" ? $this->getRequest()->getParam('from_date') : ""; $filter_data_to = $this->getRequest()->getParam('to_date') != "" ? $this->getRequest()->getParam('to_date') : ""; $from = null; $to = null; if ($filter_data_to) { $todate = date_create($filter_data_to); $to = date_format($todate, 'Y-m-d H:i:s'); } if ($filter_data_frm) { $fromdate = date_create($filter_data_frm); $from = date_format($fromdate, 'Y-m-d H:i:s'); } $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->addFieldToFilter('name', array('like' => "%" . $filter . "%"))->setOrder('entity_id', 'AESC'); $products = array(); foreach ($collection as $data) { array_push($products, $data->getEntityId()); } $collection = Mage::getModel('mpassignproduct/mpassignproduct')->getCollection()->addFieldToFilter('product_id', array('in' => $products))->addFieldToFilter('created_at', array('datetime' => true, 'from' => $from, 'to' => $to))->addFieldToFilter('seller_id', array('eq' => $userId)); if ($filter_prostatus != "") { $collection->addFieldToFilter('flag', array('eq' => $filter_prostatus)); } $this->setCollection($collection); }
public function __construct() { parent::__construct(); //TODO: add full name logic $orders = Mage::getResourceModel('sales/order_collection')->addAttributeToSelect('*')->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')->addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())->addAttributeToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))->addAttributeToSort('created_at', 'desc')->setPageSize('5')->load(); $this->setOrders($orders); }
public function __construct() { $this->_loadData(); $this->setStores(array()); $this->setLanguages(array()); return parent::__construct(); }
/** * initialize * @access public * @author Ultimate Module Creator */ public function __construct() { parent::__construct(); $vouchers = Mage::getResourceModel('instapago_voucher/voucher_collection')->addStoreFilter(Mage::app()->getStore())->addFieldToFilter('status', 1); $vouchers->setOrder('ordernumber', 'asc'); $this->setVouchers($vouchers); }
public function __construct() { $params = $this->getRequest()->getParams(); $action = Mage::app()->getRequest()->getActionName(); // could be: index, foto, video or foto-video //Zend_Debug::dump($params); die(); parent::__construct(); $collection = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('furnizor_account_type')->addAttributeToSelect('furnizor_company_name')->addAttributeToSelect('furnizor_company_type')->addAttributeToSelect('furnizor_company_services')->addAttributeToSelect('furnizor_company_cstzone')->addAttributeToSelect('furnizor_location_province')->addAttributeToSelect('furnizor_location_city')->addAttributeToSelect('business_images_logo')->addAttributeToSelect('business_descriptions_slogan')->addAttributeToSelect('business_descriptions_exp')->addAttributeToSelect('business_descriptions_slogan')->addAttributeToSelect('business_descriptions_desc')->addAttributeToSelect('furnizor_company_zone')->addAttributeToSelect('provider_reputation')->addAttributeToSelect('provider_views')->addAttributeToSelect('business_descriptions_title')->addAttributeToFilter('group_id', 4)->addAttributeToFilter('furnizor_account_status', array('in' => array(1, 2)))->addAttributeToFilter('furnizor_account_online_status', 1)->addAttributeToFilter('ac_op_afisare_profil', 1); //$collection->getSelect()->order('e.provider_reputation DESC'); // add region filter to collection if (isset($params['judet'])) { $collection->addAttributeToFilter('furnizor_location_province', $params['judet']); } // add service type filter to collection switch ($action) { case 'foto': $collection->addAttributeToFilter('furnizor_company_services', 1); break; case 'video': $collection->addAttributeToFilter('furnizor_company_services', 2); break; case 'fotovideo': $collection->addAttributeToFilter('furnizor_company_services', 3); break; } // Zend_Debug::dump($collection->getSize()); $collection->setOrder('provider_reputation', 'DESC'); $this->setCollection($collection); }
public function __construct() { $storeId = Mage::app()->getStore()->getStoreId(); parent::__construct(); $collection = Mage::getModel('blogmate/blogmate')->getCollection()->addAttributeToSelect('*')->setStoreId($storeId); $this->setCollection($collection); }
/** * Contructor */ public function __construct($attributes = array()) { parent::__construct($attributes); if ($this->hasData("template") && $this->getData("template")) { $my_template = $this->getData("template"); } else { $my_template = "ves/blockbuilder/page_head.phtml"; } $this->setTemplate($my_template); /*Cache Block*/ $enable_cache = $this->getConfig("enable_cache", 1); if (!$enable_cache) { $cache_lifetime = null; } else { $cache_lifetime = $this->getConfig("cache_lifetime", 86400); $cache_lifetime = (int) $cache_lifetime > 0 ? $cache_lifetime : 86400; } $this->addData(array('cache_lifetime' => $cache_lifetime)); $magento_version = Mage::getVersion(); $magento_version = str_replace(".", "", $magento_version); if ((int) $magento_version >= 1900) { $this->addCacheTag(array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG, Ves_BlockBuilder_Model_Block::CACHE_MEDIA_TAG)); } /*End Cache Block*/ }
public function __construct() { $storeId = Mage::app()->getStore()->getStoreId(); parent::__construct(); $collection = Mage::getModel('blogmate/blog')->getCollection()->addFieldToFilter('status', array('eq' => '1'))->addFieldToFilter('stores_selected', array(array('like' => '%' . $storeId . '%'), array('like' => '%0%')))->addOrder('display_order', 'ASC'); $this->setCollection($collection); }
/** * Class constructor */ public function __construct() { parent::__construct(); $session = Mage::getSingleton('customer/session'); $purchased = Mage::getResourceModel('downloadable/link_purchased_collection') ->addFieldToFilter('customer_id', $session->getCustomerId()) ->addOrder('created_at', 'desc'); $this->setPurchased($purchased); $purchasedIds = array(); foreach ($purchased as $_item) { $purchasedIds[] = $_item->getId(); } if (empty($purchasedIds)) { $purchasedIds = array(null); } $purchasedItems = Mage::getResourceModel('downloadable/link_purchased_item_collection') ->addFieldToFilter('purchased_id', array('in' => $purchasedIds)) ->addFieldToFilter('status', array( 'nin' => array( Mage_Downloadable_Model_Link_Purchased_Item::LINK_STATUS_PENDING_PAYMENT, Mage_Downloadable_Model_Link_Purchased_Item::LINK_STATUS_PAYMENT_REVIEW, ICC_Ecodes_Helper_Downloadable::LINK_STATUS_DELETED ) ) ) ->setOrder('item_id', 'desc'); $this->setItems($purchasedItems); }
public function __construct() { parent::__construct(); $this->setTemplate('referafriend/points.phtml'); $points = Mage::getModel('rewardpoints/stats')->getCollection()->addClientFilter(Mage::getSingleton('customer/session')->getCustomer()->getId()); $this->setPoints($points); }
public function __construct() { parent::__construct(); if ($this->showMoreButton()) { $this->setTemplate('gomage/navigation/catalog/product/list/more.phtml'); } }
public function __construct() { parent::__construct(); $collection = Mage::getModel('evidencija/evidencija')->getCollection(); $collection->setOrder('entity_id', 'DESC'); $this->setCollection($collection); }
public function __construct() { parent::__construct(); $ids = $this->latestEvents(); $collection = Mage::getModel("eventmanager/eventmanager")->getCollection()->addFieldToFilter("status", "1")->addFieldToFilter("event_id", array("in" => $ids))->setOrder("edate", "ASC"); $this->setCollection($collection); }
public function __construct() { parent::__construct(); $customerId = Mage::getSingleton('customer/session')->getCustomerId(); $collection = Mage::getModel('marketplace/question')->getCollection()->addFieldToFilter('customer_id', $customerId)->setOrder('entity_id', 'DESC'); $this->setCollection($collection); }
/** * Contructor */ public function __construct($attributes = array()) { $this->convertAttributesToConfig($attributes); $this->_show = $this->getConfig("show"); if (!$this->_show) { return; } /*End init meida files*/ parent::__construct($attributes); $this->slider_code = $this->getConfig("slider_code"); $this->_banner_id = $this->getConfig("bannerId", 0); if ($this->hasData("template") && $this->getData('template')) { $my_template = $this->getData("template"); } else { $my_template = "ves/layerslider/default.phtml"; } $this->setTemplate($my_template); /*Cache Block*/ $enable_cache = $this->getConfig("enable_cache", 1); if (!$enable_cache) { $cache_lifetime = null; } else { $cache_lifetime = $this->getConfig("cache_lifetime", 86400); $cache_lifetime = (int) $cache_lifetime > 0 ? $cache_lifetime : 86400; } $this->addData(array('cache_lifetime' => $cache_lifetime)); $this->addCacheTag(array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG, Ves_Layerslider_Model_Config::CACHE_BLOCK_TAG)); }
public function __construct() { parent::__construct(); if (!$this->getTemplate()) { $this->setTemplate('unirgy/tiership/vendor/v2/simple_rates.phtml'); } }
public function __construct() { parent::__construct(); $collection = Mage::getModel('servisnilist/slistcustomers')->getCollection(); $collection->setOrder('entity_id', 'DESC'); $this->setCollection($collection); }
public function __construct(array $args = array()) { parent::__construct($args); if (method_exists($this, 'addCacheTag')) { $this->addCacheTag(Webguys_Easytemplate_Helper_Cache::CACHE_TAG); } }
public function __construct() { parent::__construct(); $this->setTemplate('amasty/amconf/icons.phtml'); $this->_doUpload(); $this->_confAttr = Mage::getModel('amconf/attribute')->load(Mage::registry('entity_attribute')->getId(), 'attribute_id'); }
public function __construct() { parent::__construct(); $this->setTemplate('rewardpoints/referral.phtml'); $referred = Mage::getResourceModel('rewardpoints/referral_collection')->addClientFilter(Mage::getSingleton('customer/session')->getCustomer()->getId()); $this->setReferred($referred); }
/** * initialize * * @access public * @author Ultimate Module Creator */ public function __construct() { parent::__construct(); $articles = Mage::getResourceModel('stovpak_article/article_collection')->addStoreFilter(Mage::app()->getStore())->addFieldToFilter('status', 1); $articles->setOrder('title', 'asc'); $this->setArticles($articles); }
public function __construct() { parent::__construct(); $this->setTemplate('tag/customer/list.phtml'); $this->_collection = Mage::getModel('tag/tag')->getEntityCollection(); $this->_collection->addStoreFilter(Mage::app()->getStore()->getId())->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId())->setDescOrder()->setPageSize(5)->setActiveFilter()->load()->addProductTags(); }
public function __construct($attributes = array()) { parent::__construct(); $this->_config = Mage::helper('megamenu/default')->get($attributes); if (!$this->_config['isenabled']) { return; } if ($this->filterRouter()) { if ($this->_typeCurrentUrl == Sns_Megamenu_Model_System_Config_Source_Type::CMSPAGE) { $item_id = $this->_itemCurrentUrl; } if ($this->_typeCurrentUrl == Sns_Megamenu_Model_System_Config_Source_Type::PRODUCT) { $item_id = 'product/' . $this->_itemCurrentUrl->getId(); } if ($this->_typeCurrentUrl == Sns_Megamenu_Model_System_Config_Source_Type::CATEGORY) { $item_id = 'category/' . $this->_itemCurrentUrl->getId(); } $this->_allActivedItems = Mage::helper('megamenu')->getAllActivedItems($this->_typeCurrentUrl, $item_id, $this->_config['group_id']); $this->_allActivedId = $this->_allActivedItems->getALLIds(); } $itemsLeaf = Mage::helper('megamenu')->getAllLeafByGroupId($this->_config['group_id']); $this->_allLeafId = $itemsLeaf ? $itemsLeaf->getALLIds() : ''; if (!$this->_allItemsFirstColumnId) { $itemsFirstColumn = Mage::helper('megamenu')->getAllItemsFirstByGroupId($this->_config['group_id']); $this->_allItemsFirstColumnId = $itemsFirstColumn ? $itemsFirstColumn->getALLIds() : ''; } }
public function __construct() { parent::__construct(); $userId = $this->getProfileDetail()->getMageuserid(); $collection = Mage::getModel('marketplace/feedback')->getCollection()->addFieldToFilter('status', array('neq' => 0))->addFieldToFilter('proownerid', array('eq' => $userId)); $this->setCollection($collection); }
public function __construct() { parent::__construct(); $productsku = $this->getRequest()->getParam('ps'); $collection = Mage::getModel('productqa/productqa')->getCollection()->addFieldToFilter('product_sku', $productsku)->addFieldToFilter('status', 1)->setOrder('productqa_id', 'DESC'); $this->setCollection($collection); }
public function __construct() { parent::__construct(); $this->setTemplate('review/customer/list.phtml'); $this->_collection = Mage::getModel('review/review')->getProductCollection(); $this->_collection->addStoreFilter(Mage::app()->getStore()->getId())->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId())->setDateOrder()->setPageSize(5)->load()->addReviewSummary(); }
public function __construct() { parent::__construct(); $customer_id = (int) Mage::getSingleton("customer/session")->getCustomer()->getId(); $item = isset($_GET['item']) ? $_GET['item'] : 1; switch ($item) { case 1: $this->_arrayResult = Mage::helper('affiliate')->treeNetwork($customer_id, '', null, 0); break; case 2: $this->_arrayResult = Mage::helper('affiliate')->affiliateNetwork($customer_id, '', null, 0); break; case 3: $this->_arrayResult = Mage::helper('affiliate')->frontalNetwork($customer_id, '', null, 0); break; case 4: $this->_arrayResult = Mage::helper('affiliate')->treeNetwork($customer_id, '', null, 0); break; default: $this->_arrayResult = Mage::helper('affiliate')->treeNetwork($customer_id, '', null, 0); break; } Mage::register('items', $this->_arrayResult); Mage::register('flag', $item); }
public function __construct() { parent::__construct(); $this->setTemplate('sales/order/details.phtml'); $this->setOrder(Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'))); Mage::registry('action')->getLayout()->getBlock('root')->setHeaderTitle(Mage::helper('sales')->__('Order Details')); }
/** * The constructor * * @return Flagbit_FeedReader_Block_Abstract */ public function __construct() { parent::__construct(); // set up the cache $this->setCacheLifetime(60 * 30); // 30 minutes }