本文整理汇总了PHP中Mage_Catalog_Block_Product_Abstract::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Block_Product_Abstract::__construct方法的具体用法?PHP Mage_Catalog_Block_Product_Abstract::__construct怎么用?PHP Mage_Catalog_Block_Product_Abstract::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Block_Product_Abstract
的用法示例。
在下文中一共展示了Mage_Catalog_Block_Product_Abstract::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Contructor
*/
public function __construct($attributes = array())
{
$helper = Mage::helper('ves_productcarousel2/data');
$this->_show = $this->getConfig("show");
if (!$this->_show) {
return;
}
if (!$this->_show || !$this->getConfig('show')) {
return;
}
$theme = $this->getConfig('theme') != "" ? $this->getConfig('theme') : "default";
$cms = "";
$cms_block_id = $this->getConfig('cmsblock');
if ($cms_block_id) {
$cms = Mage::getSingleton('core/layout')->createBlock('cms/block')->setBlockId($cms_block_id)->toHtml();
}
$items = $this->getListProducts();
$this->assign("items", $items);
$this->assign("cms", $cms);
$my_template = $this->getTemplate();
if (empty($my_template)) {
$template = 'ves/productcarousel2/default.phtml';
if ($this->getConfig("template")) {
$template = $this->getConfig("template");
}
$this->setTemplate($template);
}
parent::__construct();
}
示例2: __construct
public function __construct()
{
parent::__construct();
// $this->setTemplate('reports/product_viewed.phtml');
$ignore = null;
if (($product = Mage::registry('product')) && $product->getId()) {
$ignore = $product->getId();
}
$customer = Mage::getSingleton('customer/session')->getCustomer();
if ($customer->getId()) {
$subjectId = $customer->getId();
$subtype = 0;
} else {
$subjectId = Mage::getSingleton('log/visitor')->getId();
$subtype = 1;
}
$collection = Mage::getModel('reports/event')->getCollection()->addRecentlyFiler(1, $subjectId, $subtype, $ignore);
$productIds = array();
foreach ($collection as $event) {
$productIds[] = $event->getObjectId();
}
unset($collection);
$productCollection = null;
if ($productIds) {
$productCollection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('name')->addAttributeToSelect('price')->addAttributeToSelect('small_image')->addIdFilter($productIds);
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($productCollection);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($productCollection);
$productCollection->setPageSize(5)->setCurPage(1)->load();
}
$this->setRecentlyViewedProducts($productCollection);
}
示例3: __construct
public function __construct($attributes = array())
{
$helper = Mage::helper('joomlart_jmproductsdeal/data');
$this->_config['show'] = $helper->get('show', $attributes);
if (!$this->_config['show']) {
return;
}
$this->_config['template'] = $helper->get('template', $attributes);
if (!$this->_config['template']) {
return;
}
parent::__construct();
$this->_config['mode'] = $helper->get('mode', $attributes);
$this->_config['title'] = $helper->get('title', $attributes);
$this->_config['catsid'] = $helper->get('catsid', $attributes);
$this->_config['qty'] = $helper->get('quanlity', $attributes);
$this->_config['qty'] = $this->_config['qty'] > 0 ? $this->_config['qty'] : $listall;
$this->_config['perrow'] = $helper->get('perrow', $attributes);
$this->_config['perrow'] = $this->_config['perrow'] > 0 ? $this->_config['perrow'] : 3;
$this->_config['width'] = $helper->get('width', $attributes);
$this->_config['width'] = $this->_config['width'] > 0 ? $this->_config['width'] : 135;
$this->_config['height'] = $helper->get('height', $attributes);
$this->_config['height'] = $this->_config['height'] > 0 ? $this->_config['height'] : 135;
$this->_config['max'] = $helper->get('max', $attributes);
$this->_config['max'] = $this->_config['max'] > 0 ? $this->_config['max'] : 0;
$this->_config['showproductleft'] = $helper->get('showproductleft', $attributes);
$this->_config['showdiscount'] = $helper->get('showdiscount', $attributes);
$this->_config['showitemsold'] = $helper->get('showitemsold', $attributes);
$this->_config['showsaleenddate'] = $helper->get('showsaleenddate', $attributes);
$this->_config['showsaveamount'] = $helper->get('showsaveamount', $attributes);
$this->setProductCollection($this->getCategory());
}
示例4: __construct
public function __construct()
{
parent::__construct();
if (array_key_exists('c', $_GET)) {
$cate = Mage::getModel('catalog/category')->load($_GET["c"]);
}
$partner = $this->getProfileDetail();
$productname = $this->getRequest()->getParam('name');
$querydata = Mage::getModel('marketplace/product')->getCollection()->addFieldToFilter('userid', array('eq' => $partner->getmageuserid()))->addFieldToFilter('status', array('neq' => 2))->setOrder('mageproductid');
$rowdata = array();
foreach ($querydata as $value) {
$stock_item_details = Mage::getModel('cataloginventory/stock_item')->loadByProduct($value->getMageproductid());
$stock_availability = $stock_item_details->getIsInStock();
if ($stock_availability) {
$rowdata[] = $value->getMageproductid();
}
}
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('*');
if (array_key_exists('c', $_GET)) {
$collection->addCategoryFilter($cate);
}
$collection->addAttributeToFilter('entity_id', array('in' => $rowdata));
if (Mage::helper('core')->isModuleEnabled('Webkul_Webkulsearch') && $productname != '') {
$collection->addFieldToFilter('name', array('like' => '%' . $productname . '%'));
}
$this->setCollection($collection);
}
示例5: __construct
public function __construct($attributes = array())
{
$helper = Mage::helper('ves_verticalmenu/data');
$this->_config = $helper->get($attributes);
/* End init meida files */
parent::__construct();
}
示例6: __construct
public function __construct($attributes = array())
{
$helper = Mage::helper('joomlart_jmproducts/data');
$mode = $this->getRequest()->getParam('type');
$viewall = $this->getRequest()->getParam('viewall');
$this->_config['show'] = $helper->get('show', $attributes);
if (!$this->_config['show']) {
return;
}
$this->_config['template'] = $helper->get('template', $attributes);
if (!$this->_config['template']) {
return;
}
parent::__construct();
$this->_config['mode'] = $helper->get('mode', $attributes);
$this->_config['title'] = $helper->get('title', $attributes);
$this->_config['catsid'] = $helper->get('catsid', $attributes);
$this->_config['productsid'] = $helper->get('productsid', $attributes);
$this->_config['qty'] = $helper->get('quanlity', $attributes);
$this->_config['qty'] = $this->_config['qty'] > 0 ? $this->_config['qty'] : $listall;
$this->_config['perrow'] = $helper->get('perrow', $attributes);
$this->_config['perrow'] = $this->_config['perrow'] > 0 ? $this->_config['perrow'] : 3;
$this->_config['width'] = $helper->get('width', $attributes);
$this->_config['width'] = $this->_config['width'] > 0 ? $this->_config['width'] : 135;
$this->_config['height'] = $helper->get('height', $attributes);
$this->_config['height'] = $this->_config['height'] > 0 ? $this->_config['height'] : 135;
$this->setProductCollection($this->getCategory());
}
示例7: __construct
public function __construct($attributes = array())
{
$helper = Mage::helper('joomlart_jmproducts/data');
$this->_config['show'] = $helper->get('show', $attributes);
if (!$this->_config['show']) {
return;
}
$this->_config['template'] = $helper->get('template', $attributes);
if (!$this->_config['template']) {
return;
}
parent::__construct();
//get cache status
$cacheType = 'joomlart_jmproducts';
$useCache = Mage::app()->useCache($cacheType);
if ($useCache) {
$this->addData(array('cache_key' => $this->getCacheId($attributes), 'cache_lifetime' => $this->cacheLifeTime));
}
$this->_config['mode'] = $helper->get('mode', $attributes);
$this->_config['title'] = $helper->get('title', $attributes);
$this->_config['catsid'] = $helper->get('catsid', $attributes);
$this->_config['productsid'] = $helper->get('productsid', $attributes);
$this->_config['qty'] = $helper->get('quanlity', $attributes);
$this->_config['qtyperpage'] = $helper->get('quanlityperpage', $attributes);
if (!$this->_config['qtyperpage']) {
$this->_config['qtyperpage'] = 10;
}
$this->_config['perrow'] = $helper->get('perrow', $attributes);
$this->_config['width'] = $helper->get('width', $attributes);
$this->_config['height'] = $helper->get('height', $attributes);
}
示例8: __construct
/**
* Contructor
*/
public function __construct($attributes = array())
{
$this->setDefaultSettings();
$this->convertAttributesToConfig($attributes);
$theme = $this->getConfig('theme') != "" ? $this->getConfig('theme') : "default";
parent::__construct();
if (isset($attributes['template']) && $attributes['template']) {
$this->setTemplate($attributes['template']);
} elseif ($this->hasData("template")) {
$this->setTemplate($this->getData('template'));
} elseif ($this->getConfig("enable_owl_carousel", "carousel_setting", 0)) {
$template = 'ves/productcarousel/default_owl.phtml';
$this->setTemplate($template);
} else {
$template = 'ves/productcarousel/default.phtml';
$this->setTemplate($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_ProductCarousel_Model_Config::CACHE_BLOCK_TAG));
/*End Cache Block*/
}
示例9: __construct
public function __construct()
{
parent::__construct();
$productSize = 5;
// No Of Products Display in Frontend
$storeId = Mage::app()->getStore()->getId();
$sql = "SELECT f.product_id, f.qty_ordered FROM sales_flat_order_item as f, sales_order as s WHERE s.entity_id = f.order_id and s.store_id = {$storeId} and f.parent_item_id is NULL";
$data = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);
$output = array();
foreach ($data as $d) {
if (isset($output[$d['product_id']])) {
$output[$d['product_id']] += $d['qty_ordered'];
} else {
$output[$d['product_id']] = $d['qty_ordered'];
}
}
arsort($output);
$final = array_slice(array_keys($output), 0, $productSize);
$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToSelect('*');
$products->addAttributeToFilter('entity_id', array('in' => $final));
$products->load();
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
$this->setProductCollection($products);
}
示例10: __construct
public function __construct($attributes = array())
{
$helper = Mage::helper('joomlart_jmproducts/data');
$this->_config['show'] = $helper->get('show', $attributes);
if (!$this->_config['show']) {
return;
}
$this->_config['template'] = $helper->get('template', $attributes);
if (!$this->_config['template']) {
return;
}
parent::__construct();
$this->_config['mode'] = $helper->get('mode', $attributes);
$this->_config['title'] = $helper->get('title', $attributes);
$this->_config['catsid'] = $helper->get('catsid', $attributes);
$this->_config['productsid'] = $helper->get('productsid', $attributes);
$this->_config['qty'] = $helper->get('quanlity', $attributes);
$this->_config['qtyperpage'] = $helper->get('quanlityperpage', $attributes);
if (!$this->_config['qtyperpage']) {
$this->_config['qtyperpage'] = 10;
}
$this->_config['perrow'] = $helper->get('perrow', $attributes);
$this->_config['width'] = $helper->get('width', $attributes);
$this->_config['height'] = $helper->get('height', $attributes);
}
示例11: __construct
public function __construct()
{
$this->configP = Mage::getStoreConfig('dailydeal/general');
parent::__construct();
$maxday = 350;
$from = (int) @$_GET['from'];
$to = (int) @$_GET['to'];
$to = $to == $maxday ? 0 : $to;
$datefrom = date('Y-m-d H:i:s', mktime(0, 0, 0, date('m'), date('d') + $from, date('y')));
$dateto = date('Y-m-d H:i:s', mktime(0, 0, 0, date('m'), date('d') + $to, date('y')));
$todayDate = date('Y-m-d H:i:s');
//echo $todayDate;
// $todayDate = '2014-01-11 11:24:39 ';
// $dateFrom = Mage::app()->getLocale()->date($todayDate, Varien_Date::DATETIME_INTERNAL_FORMAT);
// echo Mage::getModel('core/date')->gmtDate(null, time());
//echo Mage::getModel('core/date')->gmtDate();
//echo Mage::getModel('core/date')->gmtDate(null, time());
// echo $dateFrom = Mage::app()->getLocale()->date(date('Y-m-d H:i:s'), Varien_Date::DATETIME_INTERNAL_FORMAT);
$tomorrow = mktime(0, 0, 0, date('m'), date('d') + 1, date('y'));
$tomorrowDate = date('m/d/y', $tomorrow);
$collection = Mage::getResourceModel('catalogsearch/advanced_collection')->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addMinimalPrice()->addStoreFilter();
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
$collection->getSelect()->join(array('t2' => Mage::getSingleton('core/resource')->getTableName('dailydeal/dailydealproducts')), '(e.entity_id = t2.productid and t2.status != 2 ' . ($from ? ' and t2.closetime >= "' . $datefrom . '"' : ' and t2.starttime <= "' . $todayDate . '"') . ($to ? ' and t2.closetime <= "' . $dateto . '"' : '') . ' and t2.closetime >= "' . $todayDate . '")', array('t2.sold', 't2.save', 't2.quantity', 't2.starttime', 't2.closetime'));
// Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
// $collection->getSelect()->join(array('t2' => Mage::getSingleton('core/resource')->getTableName('dailydeal/dailydealproducts')),'e.entity_id = t2.productid ', array('t2.sold', 't2.save', 't2.quantity', 't2.starttime', 't2.closetime'));
//$collection->getSelect()->group('e.entity_id');
// echo count($collection);
//$collection->setPageSize($this->get_prod_count())->setCurPage($this->get_cur_page());
$this->setCollection($collection);
}
示例12: __construct
/**
* Contructor
*/
public function __construct($attributes = array())
{
$this->setDefaultSettings();
if ($attributes) {
$this->convertAttributesToConfig($attributes);
}
$this->_show = $this->getConfig("show");
if (!$this->_show) {
return;
}
parent::__construct();
if ($this->hasData("template") && $this->getData("template")) {
$this->setTemplate($this->getData("template"));
} elseif (1 == $this->getConfig("enable_owl_carousel") || $this->getConfig("enable_owl_carousel", "carousel_setting")) {
$this->setTemplate('ves/deals/block/carousel_owl.phtml');
} else {
$template = 'ves/deals/block/carousel.phtml';
$this->setTemplate($template);
}
/*Cache Block*/
$enable_cache = $this->getConfig("enable_cache", "ves_deals", 1);
if (!$enable_cache) {
$cache_lifetime = null;
} else {
$cache_lifetime = $this->getConfig("cache_lifetime", "ves_deals", 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_Deals_Model_Config::CACHE_BLOCK_TAG));
/*End Cache Block*/
}
示例13: __construct
public function __construct($attributes = array())
{
$helper = Mage::helper('ves_megamenu/data');
$this->_config = $helper->get($attributes);
if ($attributes) {
$this->convertAttributesToConfig($attributes);
}
/* End init meida files */
parent::__construct();
if ($this->hasData("template") && $this->getData("template")) {
$this->setTemplate($this->getData("template"));
} else {
$this->setTemplate('ves/megamenu/default.phtml');
}
/*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_Megamenu_Model_Megamenu::CACHE_BLOCK_TAG));
/*End Cache Block*/
}
示例14: __construct
public function __construct($attr)
{
parent::__construct($attr);
$this->_config = $this->_getCfg($attr);
if (!$this->_getConfig('active', 1)) {
return;
}
$this->_storeId = Mage::app()->getStore()->getId();
}
示例15: __construct
public function __construct($attributes = array())
{
$helper = Mage::helper('ves_tempcp/data');
$this->_config = $helper->get($attributes);
/* End init meida files */
$mediaHelper = Mage::helper('ves_tempcp/media');
$config = $this->_config;
parent::__construct();
}