Esempio n. 1
0
 /**
  * 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();
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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());
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 public function __construct($attributes = array())
 {
     $helper = Mage::helper('ves_verticalmenu/data');
     $this->_config = $helper->get($attributes);
     /* End init meida files */
     parent::__construct();
 }
Esempio n. 6
0
 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());
 }
Esempio n. 7
0
 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);
 }
Esempio n. 8
0
 /**
  * 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*/
 }
Esempio n. 9
0
 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);
 }
Esempio n. 10
0
 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);
 }
Esempio n. 11
0
 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);
 }
Esempio n. 12
0
 /**
  * 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*/
 }
Esempio n. 13
0
 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*/
 }
Esempio n. 14
0
 public function __construct($attr)
 {
     parent::__construct($attr);
     $this->_config = $this->_getCfg($attr);
     if (!$this->_getConfig('active', 1)) {
         return;
     }
     $this->_storeId = Mage::app()->getStore()->getId();
 }
Esempio n. 15
0
 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();
 }
Esempio n. 16
0
 /**
  * Contructor
  */
 public function __construct($attributes = array())
 {
     $helper = Mage::helper('ves_deals/data');
     $this->_show = $this->getConfig("show");
     // die("ádasdasdasdasdasd");
     if (!$this->_show) {
         return;
     }
     parent::__construct();
 }
Esempio n. 17
0
 public function __construct($attributes = array())
 {
     $helper = Mage::helper('joomlart_jmslideshow/data');
     $this->_show = $helper->get('show', $attributes);
     if (!$this->_show) {
         return;
     }
     parent::__construct();
     $this->_config = $helper->get($attributes);
 }
Esempio n. 18
0
 public function __construct()
 {
     parent::__construct();
     $number = $this->getNumberShownProduct();
     $products = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('*')->addAttributeToFilter('fb_product', array('eq' => '1'))->addStoreFilter();
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($products);
     $products->setPageSize($number)->setCurPage(1)->load();
     $this->setProductCollection($products);
 }
 public function __construct()
 {
     parent::__construct();
     $storeId = Mage::app()->getStore()->getId();
     $products = Mage::getResourceModel('reports/product_collection')->addOrderedQty()->addAttributeToSelect('*')->addAttributeToSelect(array('name', 'price', 'small_image'))->setStoreId($storeId)->addStoreFilter($storeId)->addViewsCount();
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
     $products->setPageSize(5)->setCurPage(1);
     $this->setProductCollection($products);
 }
Esempio n. 20
0
 public function __construct($attributes = array())
 {
     $helper = Mage::helper('ves_tabshome/data');
     $this->_config = $helper->get($attributes);
     /* End init meida files */
     $mediaHelper = Mage::helper('ves_tabshome/media');
     $config = $this->_config;
     $this->setTemplate('ves/tabshome/default/item.phtml');
     parent::__construct();
 }
Esempio n. 21
0
 public function __construct($attributes = array())
 {
     $helper = Mage::helper('joomlart_jmproductsslider/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['height'] = $helper->get('height', $attributes);
     if (!$this->_config['height']) {
         $this->_config['height'] = 100;
     }
     $this->_config['width'] = $helper->get('width', $attributes);
     if (!$this->_config['width']) {
         $this->_config['width'] = 100;
     }
     $this->_config['itemheight'] = $helper->get('itemheight', $attributes);
     if (!$this->_config['itemheight']) {
         $this->_config['itemheight'] = $this->_config['height'] + 50;
     }
     $this->_config['itemwidth'] = $helper->get('itemwidth', $attributes);
     if (!$this->_config['itemwidth']) {
         $this->_config['itemwidth'] = $this->_config['width'] + 45;
     }
     $this->_config['catsid'] = $helper->get('catsid', $attributes);
     $this->_config['qty'] = $helper->get('quanlity', $attributes);
     $this->_config['qty'] = $this->_config['qty'] > 0 ? $this->_config['qty'] : 8;
     $this->_config['number_items'] = $helper->get('number_items', $attributes);
     $this->_config['number_items'] = $this->_config['number_items'] > 0 ? $this->_config['number_items'] : 4;
     $this->_config['show_price'] = $helper->get('show_price', $attributes);
     $this->_config['show_readmore'] = $helper->get('show_readmore', $attributes);
     $this->_config['show_desc'] = $helper->get('show_desc', $attributes);
     $this->_config['max'] = $helper->get('max', $attributes);
     $this->_config['max'] = $this->_config['max'] > 0 ? $this->_config['max'] : 0;
     $this->_config['show_cart'] = $helper->get('show_cart', $attributes);
     //$this->_config['direction'] = $helper->get('direction', $attributes);
     $this->_config['use_scrollerbar'] = $helper->get('use_scrollerbar', $attributes);
     $this->_config['delaytime'] = $helper->get('delaytime', $attributes);
     $this->_config['autorun'] = $helper->get('autorun', $attributes);
     if (!$this->_config['delaytime']) {
         $this->_config['autorun'] = 0;
     }
     $this->_config['animationtime'] = $helper->get('animationtime', $attributes);
     $this->_config['attributename'] = $helper->get('attributename', $attributes);
     $this->_config['attributevalue'] = $helper->get('attributevalue', $attributes);
     $this->_config['hover'] = $helper->get('hover', $attributes);
     $this->_config['desc'] = $helper->get('desc', $attributes);
 }
Esempio n. 22
0
 public function __construct()
 {
     parent::__construct();
     $storeId = Mage::app()->getStore()->getId();
     $config = Mage::getStoreConfig('mtdendadmin/product');
     $qty = $config['product_bestseller_numb'];
     $products = Mage::getResourceModel('reports/product_collection')->addOrderedQty()->addAttributeToSelect('*')->setStoreId($storeId)->addStoreFilter($storeId)->setOrder('ordered_qty', 'desc');
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
     $products->setPageSize($qty)->setCurPage(1);
     $this->setProductCollection($products);
 }
Esempio n. 23
0
 public function __construct($attributes = array())
 {
     $helper = Mage::helper('joomlart_jmmasshead/data');
     $this->_config['show'] = $helper->get('show', $attributes);
     if (!$this->_config['show']) {
         return;
     }
     parent::__construct();
     $this->_config['title'] = $helper->get('title', $attributes);
     $this->_config['background'] = $helper->get('background', $attributes);
     $this->_config['description'] = $helper->get('description', $attributes);
 }
Esempio n. 24
0
 public function __construct()
 {
     parent::__construct();
     $storeId = Mage::app()->getStore()->getId();
     $collection = Mage::getResourceModel('catalog/product_collection');
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
     $collection = $this->_addProductAttributesAndPrices($collection)->addStoreFilter()->addAttributeToFilter('featured', array('yes' => true))->addAttributeToSelect('status');
     /* @var $products Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */
     $collection->setOrder('updated_at')->setPageSize(5)->setCurPage(1);
     $this->setProductCollection($collection);
 }
Esempio n. 25
0
 public function __construct($attributes = array())
 {
     $helper = Mage::helper('joomlart_jmslideshow/data');
     //Handle configs value from configs or static block call line.
     foreach ($helper::$_params as $paramKey) {
         $this->_configs[$paramKey] = $helper->get($paramKey, $attributes);
     }
     //Check enabled sideshow
     if (!$this->_configs['show']) {
         return;
     }
     parent::__construct();
 }
Esempio n. 26
0
 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;
     //$responsive = (empty($config['responsive'])) ? 0 : $config['responsive'];
     //if($responsive == 1){
     //    $mediaHelper->addMediaFile("skin_css", "ves_tempcp/responsive.css");
     $mediaHelper->addMediaFile("skin_css", "ves_tempcp/style.css");
     parent::__construct();
 }
Esempio n. 27
0
 public function __construct()
 {
     parent::__construct();
     //$todayDate = date('Y-m-d').' 00:00:00';
     $todayDate = date('Y-m-d H:i:s');
     $tomorrow = mktime(0, 0, 0, date('m'), date('d') + 1, date('y'));
     $tomorrowDate = date('Y-m-d H:i:s', $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 and t2.ishome = 1 and t2.starttime <= "' . $todayDate . '" and t2.closetime >= "' . $todayDate . '")', array('t2.sold', 't2.save', 't2.starttime', 't2.closetime'))->group('e.entity_id')->order(array('t2.starttime ASC', 'e.entity_id DESC'));
     $collection->setPageSize($this->getPs())->setCurPage(1);
     $this->setCollection($collection);
 }
Esempio n. 28
0
 public function __construct($attr)
 {
     parent::__construct($attr);
     if ($this->_isAjax()) {
         $_cfg = Mage::app()->getRequest()->getParam('config');
         $this->_config = (array) json_decode(base64_decode(strtr($_cfg, '-_', '+/')));
     } else {
         $this->_config = $this->_getCfg($attr);
     }
     if (!$this->_getConfig('active', 1)) {
         return;
     }
     $this->_storeId = Mage::app()->getStore()->getId();
 }
Esempio n. 29
0
 /**
  * Contructor
  */
 public function __construct($attributes = array())
 {
     $helper = Mage::helper('lof_slider/data');
     $this->_config = $helper->get($attributes);
     $this->_show = $this->getConfig("show");
     if (!$this->_show) {
         return;
     }
     /*End init meida files*/
     $mediaHelper = Mage::helper('lof_slider/media');
     $this->_theme = $this->getConfig("theme");
     $mediaHelper->addMediaFile("skin_css", "lof_slider/" . $this->_theme . "/style.css");
     parent::__construct();
 }
 public function __construct()
 {
     parent::__construct();
     $storeId = Mage::app()->getStore()->getId();
     $product = Mage::getModel('catalog/product');
     /* @var $product Mage_Catalog_Model_Product */
     $todayDate = $product->getResource()->formatDate(time());
     $products = $product->setStoreId($storeId)->getCollection()->addAttributeToFilter('home_page_featured', array('yes' => true))->addAttributeToSelect(array('name', 'price', 'small_image'), 'inner')->addAttributeToSelect(array('special_price', 'special_from_date', 'special_to_date'), 'left');
     /* @var $products Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
     $products->setOrder('hot_deals')->setPageSize(5)->setCurPage(1);
     $this->setProductCollection($products);
 }