/**
  * @param Mage_Core_Block_Template $parent
  * @param $items
  */
 protected function _createChildBlocksRecursively($parent, $items)
 {
     foreach ($items as $key => $item) {
         $block = $this->getLayout()->createBlock('manapro_filtertree/item', $parent->getNameInLayout() . '_' . $key, array('item' => $item, 'filter' => $this, 'template' => 'manapro/filtertree/item.phtml', 'show_in_filter' => $this->getShowInFilter()));
         $parent->setChild($parent->getNameInLayout() . '_' . $key, $block);
         $this->_createChildBlocksRecursively($block, $item->getItems());
     }
 }
 public function manejandobloquesAction()
 {
     $block_1 = new Mage_Core_Block_Text();
     $block_1->setText('Original Text');
     $block_2 = new Mage_Core_Block_Text();
     $block_2->setText('The second sentence.');
     $main_block = new Mage_Core_Block_Template();
     $main_block->setTemplate('nofrills/manejandobloques.phtml');
     $main_block->setChild('the_first', $block_1);
     $main_block->setChild('the_second', $block_2);
     $block_1->setText('Wait , I want this text instead .');
     echo $main_block->toHtml();
 }
Example #3
0
 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'));
 }
 protected function _toHtml()
 {
     if (!(bool) Mage::getStoreConfig('specialproducts/general/active')) {
         return '';
     }
     return parent::_toHtml();
 }
Example #5
0
 protected function _toHtml()
 {
     if ($this->_collection->getSize() > 0) {
         return parent::_toHtml();
     }
     return '';
 }
Example #6
0
 protected function _toHtml()
 {
     if (is_link(dirname(Mage::getModuleDir('', 'PostcodeNl_Api'))) && !Mage::getStoreConfig('dev/template/allow_symlink')) {
         throw new Mage_Core_Exception('Postcode.nl API Development: Symlinks not enabled! (set at Admin->System->Configuration->Advanced->Developer->Template Settings)');
     }
     return parent::_toHtml();
 }
Example #7
0
 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();
 }
Example #8
0
 /**
  * Render block HTML
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (!$this->getCanUseToken()) {
         return '';
     }
     return parent::_toHtml();
 }
Example #9
0
 protected function _toHtml()
 {
     if (Mage::helper('sales/reorder')->isAllow() && Mage::getSingleton('customer/session')->isLoggedIn()) {
         return parent::_toHtml();
     }
     return '';
 }
 public function _toHtml()
 {
     if (!Mage::getSingleton('helpdesk/config')->getSatisfactionIsActive()) {
         return '';
     }
     return parent::_toHtml();
 }
Example #11
0
 protected function _construct()
 {
     $this->setTemplate('arioem/part/selector.phtml');
     // here we need to let Magento independent ARI API gateway know what's the current customer cost
     Mage::getSingleton('customer/session')->unsCustomerCostPercent()->setCustomerCostPercent(Mage::helper('arioem')->getCustomerCostPercent());
     return parent::_construct();
 }
Example #12
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->getLayout()->createBlock('catalog/breadcrumbs');
     if ($headBlock = $this->getLayout()->getBlock('head')) {
         $category = $this->getCurrentCategory();
         if ($title = $category->getMetaTitle()) {
             $headBlock->setTitle($title);
         }
         if ($description = $category->getMetaDescription()) {
             $headBlock->setDescription($description);
         }
         if ($keywords = $category->getMetaKeywords()) {
             $headBlock->setKeywords($keywords);
         }
         if ($this->helper('catalog/category')->canUseCanonicalTag()) {
             $headBlock->addLinkRel('canonical', $category->getUrl());
         }
         /*
         want to show rss feed in the url
         */
         if ($this->IsRssCatalogEnable() && $this->IsTopCategory()) {
             $title = $this->helper('rss')->__('%s RSS Feed', $this->getCurrentCategory()->getName());
             $headBlock->addItem('rss', $this->getRssLink(), 'title="' . $title . '"');
         }
     }
     return $this;
 }
 public function _toHtml()
 {
     if (!Mage::helper('checkout')->isMultishippingCheckoutAvailable()) {
         return '';
     }
     return parent::_toHtml();
 }
Example #14
0
 /**
  * Render GA tracking scripts
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (!Mage::helper('enterprise_googleanalyticsuniversal')->isTagManagerAvailable()) {
         return '';
     }
     return parent::_toHtml();
 }
 /**
  * {@inheritdoc}
  */
 protected function _toHtml()
 {
     $this->setChild('xml', $this->getLayout()->createBlock('realtimedespatch/adminhtml_exports_view_accordion'));
     $this->getChild('xml')->setExport($this->getExport());
     $this->getChild('lines')->setExport($this->getExport())->setReferenceLabel($this->getReferenceLabel());
     return parent::_toHtml();
 }
Example #16
0
 public function _prepareLayout()
 {
     parent::_prepareLayout();
     $pager = $this->getLayout()->createBlock('page/html_pager', 'history_pager')->setCollection($this->getCollection());
     $this->setChild('history_pager', $pager);
     return $this;
 }
 /**
  * Convert block to html sting.
  * Checks is possible to show newsletter checkbox
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (!$this->helper('fi_checkout')->isVisibleNewsletter() || Mage::helper('fi_checkout')->isCustomerSubscribed()) {
         return '';
     }
     return parent::_toHtml();
 }
 public function delayedPrepareLayout()
 {
     $layer = $this->getLayer();
     if ($this->getShowRootCategory()) {
         $this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());
     }
     if (Mage::registry('product')) {
         $categories = Mage::registry('product')->getCategoryCollection()->setPage(1, 1)->load();
         if ($categories->count()) {
             $this->setCategoryId(current($categories->getIterator()));
         }
     }
     $origCategory = null;
     if ($this->getCategoryId()) {
         $category = Mage::getModel('catalog/category')->load($this->getCategoryId());
         if ($category->getId()) {
             $origCategory = $layer->getCurrentCategory();
             $layer->setCurrentCategory($category);
         }
         $categoryId = $this->getCategoryId();
     } else {
         $categoryId = Mage::app()->getStore()->getRootCategoryId();
     }
     $this->_prepareProductCollection($layer->getProductCollection(), $categoryId);
     if ($origCategory) {
         $layer->setCurrentCategory($origCategory);
     }
     return parent::_prepareLayout();
 }
Example #19
0
 protected function _toHtml()
 {
     if (!$this->isEnabled()) {
         return '';
     }
     return parent::_toHtml();
 }
Example #20
0
 public function _toHtml()
 {
     if (Mage::getStoreConfigFlag('payment/paypaluk_express/active') && Mage::getSingleton('checkout/session')->getQuote()->validateMinimumAmount()) {
         return parent::_toHtml();
     }
     return '';
 }
Example #21
0
 protected function _toHtml()
 {
     if (!Mage::getStoreConfig('ves_base/general_setting/show')) {
         return;
     }
     return parent::_toHtml();
 }
Example #22
0
 protected function _toHtml()
 {
     if (!Mage::helper('downloads')->isEnabled()) {
         return '';
     }
     return parent::_toHtml();
 }
Example #23
0
 protected function _toHtml()
 {
     if (!$this->_canShow()) {
         return '';
     }
     return parent::_toHtml();
 }
 protected function _beforeToHtml()
 {
     if (!$this->getProductId()) {
         return false;
     }
     return parent::_beforeToHtml();
 }
Example #25
0
 public function _construct()
 {
     parent::_construct();
     $this->enabled = intval(Mage::getStoreConfig('payment/ipcpaygate/invipay_widgets_footericon')) && intval(Mage::getStoreConfig('payment/ipcpaygate/active'));
     $this->text = Mage::getStoreConfig('payment/ipcpaygate/title');
     $this->setTemplate('ipcpaygate/widgets/footericon.phtml');
 }
 protected function _prepareLayout()
 {
     if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) {
         $breadcrumbs->addCrumb('home', array('label' => Mage::helper('catalogsearch')->__('Home'), 'title' => Mage::helper('catalogsearch')->__('Go to Home Page'), 'link' => Mage::getBaseUrl()))->addCrumb('search', array('label' => Mage::helper('catalogsearch')->__('Catalog Advanced Search'), 'link' => $this->getUrl('*/*/')))->addCrumb('search_result', array('label' => Mage::helper('catalogsearch')->__('Results')));
     }
     return parent::_prepareLayout();
 }
Example #27
0
 protected function _toHtml()
 {
     if ($this->getOrders()->getSize() > 0) {
         return parent::_toHtml();
     }
     return '';
 }
 protected function _beforeToHtml()
 {
     if (!Mage::helper('magenotification')->checkLicenseKey('Sociallogin')) {
         $this->setTemplate(null);
     }
     return parent::_beforeToHtml();
 }
Example #29
0
 /**
  * Add payment info block to layout
  *
  * @return Mage_Payment_Block_Info_Container
  */
 protected function _prepareLayout()
 {
     if ($info = $this->getPaymentInfo()) {
         $this->setChild($this->_getInfoBlockName(), Mage::helper('payment')->getInfoBlock($info));
     }
     return parent::_prepareLayout();
 }
Example #30
0
 protected function _toHtml()
 {
     if ($this->getTestimonials()) {
         return parent::_toHtml();
     }
     return '';
 }