本文整理汇总了PHP中Mage_Core_Block_Template::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Block_Template::__construct方法的具体用法?PHP Mage_Core_Block_Template::__construct怎么用?PHP Mage_Core_Block_Template::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Block_Template
的用法示例。
在下文中一共展示了Mage_Core_Block_Template::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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);
}
示例2: __construct
/**
* __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);
}
示例3: __construct
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);
}
示例4: __construct
public function __construct()
{
$this->_loadData();
$this->setStores(array());
$this->setLanguages(array());
return parent::__construct();
}
示例5: __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);
}
示例6: __construct
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);
}
示例7: __construct
public function __construct()
{
$storeId = Mage::app()->getStore()->getStoreId();
parent::__construct();
$collection = Mage::getModel('blogmate/blogmate')->getCollection()->addAttributeToSelect('*')->setStoreId($storeId);
$this->setCollection($collection);
}
示例8: __construct
/**
* 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*/
}
示例9: __construct
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);
}
示例10: __construct
/**
* 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);
}
示例11: __construct
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);
}
示例12: __construct
public function __construct()
{
parent::__construct();
if ($this->showMoreButton()) {
$this->setTemplate('gomage/navigation/catalog/product/list/more.phtml');
}
}
示例13: __construct
public function __construct()
{
parent::__construct();
$collection = Mage::getModel('evidencija/evidencija')->getCollection();
$collection->setOrder('entity_id', 'DESC');
$this->setCollection($collection);
}
示例14: __construct
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);
}
示例15: __construct
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);
}