Пример #1
0
 public function _prepareLayout()
 {
     parent::_prepareLayout();
     $pager = $this->getLayout()->createBlock('page/html_pager', 'transactions_pager')->setCollection($this->getCollection());
     $this->setChild('transactions_pager', $pager);
     return $this;
 }
Пример #2
0
 protected function _construct()
 {
     parent::_construct();
     $page = $this->getPage();
     if ($pageId = $this->getPageId()) {
         $page->setStoreId(Mage::app()->getStore()->getId())->load($pageId);
     }
 }
Пример #3
0
 protected function _construct()
 {
     parent::_construct();
     $customerId = Mage::getSingleton('customer/session')->getCustomerId();
     $collection = Mage::getResourceModel('rewardpoints/transaction_collection')->addFieldToFilter('customer_id', $customerId);
     $collection->getSelect()->limit(5)->order('created_time DESC');
     $this->setCollection($collection);
 }
Пример #4
0
 /**
  * call method that defined from block helper
  * 
  * @param string $method
  * @param array $args
  * @return mixed
  */
 public function __call($method, $args)
 {
     $helper = $this->getBlockHelper();
     if (method_exists($helper, $method)) {
         return call_user_func_array(array($helper, $method), $args);
         // return call_user_method_array($method, $helper, $args);
     }
     return parent::__call($method, $args);
 }
Пример #5
0
 /**
  * prepare product info.extrahint block information
  *
  * @return Magestore_RewardPoints_Block_Template
  */
 public function _prepareLayout()
 {
     if ($this->isEnable() && version_compare(Mage::getVersion(), '1.4.1.0', '<')) {
         $productInfo = $this->getLayout()->getBlock('product.info');
         $productInfo->setTemplate('rewardpoints/product/view.phtml');
         $extrahints = $this->getLayout()->createBlock('core/text_list', 'product.info.extrahint');
         $productInfo->setChild('extrahint', $extrahints);
     }
     return parent::_prepareLayout();
 }
Пример #6
0
 /**
  * prepare block's layout
  *
  * @return Magestore_RewardPoints_Block_Name
  */
 public function _prepareLayout()
 {
     $helper = Mage::helper('rewardpoints/customer');
     if (!Mage::getStoreConfig('advanced/modules_disable_output/Magestore_RewardPoints') && $this->isEnable() && $helper->getCustomerId() && $helper->showOnToplink()) {
         $block = $this->getLayout()->getBlock('top.links');
         $accountUrl = Mage::helper('customer')->getAccountUrl();
         $nameBlock = Mage::getBlockSingleton('rewardpoints/name');
         $block->removeLinkByUrl($accountUrl);
         $block->addLink($this->__('My Account') . ' (' . $nameBlock->toHtml() . ')', $accountUrl, $this->__('My Account'), '', '', 10);
     }
     return parent::_prepareLayout();
 }
Пример #7
0
 /**
  * Render block HTML, depend on mode of name showed
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->getIsAnchorMode()) {
         if (is_null($this->_rewardAnchorHtml)) {
             $html = parent::_toHtml();
             if ($html) {
                 $this->_rewardAnchorHtml = $html;
             } else {
                 $this->_rewardAnchorHtml = '';
             }
         }
         return $this->_rewardAnchorHtml;
     } else {
         if (is_null($this->_rewardPointsHtml)) {
             $html = parent::_toHtml();
             if ($html) {
                 $this->_rewardPointsHtml = $html;
             } else {
                 $this->_rewardPointsHtml = '';
             }
         }
         return $this->_rewardPointsHtml;
     }
 }
Пример #8
0
 /**
  * prepare block's layout
  *
  * @return Magestore_RewardPoints_Block_Name
  */
 public function _prepareLayout()
 {
     $this->setTemplate('rewardpoints/name.phtml');
     return parent::_prepareLayout();
 }