Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Adminhtml_Rss_CatalogController
  • Mage_Adminhtml_Rss_OrderController
  • Mage_Rss_Block_Abstract
  • Mage_Rss_Block_Catalog_Abstract
  • Mage_Rss_Block_Catalog_Category
  • Mage_Rss_Block_Catalog_New
  • Mage_Rss_Block_Catalog_NotifyStock
  • Mage_Rss_Block_Catalog_Review
  • Mage_Rss_Block_Catalog_Salesrule
  • Mage_Rss_Block_Catalog_Special
  • Mage_Rss_Block_Catalog_Tag
  • Mage_Rss_Block_List
  • Mage_Rss_Block_Order_Details
  • Mage_Rss_Block_Order_New
  • Mage_Rss_Block_Order_Status
  • Mage_Rss_Block_Wishlist
  • Mage_Rss_CatalogController
  • Mage_Rss_Helper_Catalog
  • Mage_Rss_Helper_Data
  • Mage_Rss_Helper_Order
  • Mage_Rss_IndexController
  • Mage_Rss_Model_Mysql4_Order
  • Mage_Rss_Model_Observer
  • Mage_Rss_Model_Resource_Order
  • Mage_Rss_Model_Rss
  • Mage_Rss_Model_Session
  • Mage_Rss_Model_System_Config_Backend_Links
  • Mage_Rss_OrderController
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Rss
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: class Mage_Rss_Block_Catalog_Abstract extends Mage_Rss_Block_Abstract
 27: {
 28:     /**
 29:      * Stored price block instances
 30:      * @var array
 31:      */
 32:     protected $_priceBlock = array();
 33: 
 34:     /**
 35:      * Stored price blocks info
 36:      * @var array
 37:      */
 38:     protected $_priceBlockTypes = array();
 39: 
 40:     /**
 41:      * Default values for price block and template
 42:      * @var string
 43:      */
 44:     protected $_priceBlockDefaultTemplate = 'catalog/rss/product/price.phtml';
 45:     protected $_priceBlockDefaultType = 'catalog/product_price';
 46: 
 47:     /**
 48:      * Whether to show "As low as" as a link
 49:      * @var bool
 50:      */
 51:     protected $_useLinkForAsLowAs = true;
 52: 
 53:     /**
 54:      * Default MAP renderer type
 55:      *
 56:      * @var string
 57:      */
 58:     protected $_mapRenderer = 'msrp_rss';
 59: 
 60:     /**
 61:      * Return Price Block renderer for specified product type
 62:      *
 63:      * @param string $productTypeId Catalog Product type
 64:      * @return Mage_Core_Block_Abstract
 65:      */
 66:     protected function _getPriceBlock($productTypeId)
 67:     {
 68:         if (!isset($this->_priceBlock[$productTypeId])) {
 69:             $block = $this->_priceBlockDefaultType;
 70:             if (isset($this->_priceBlockTypes[$productTypeId])) {
 71:                 if ($this->_priceBlockTypes[$productTypeId]['block'] != '') {
 72:                     $block = $this->_priceBlockTypes[$productTypeId]['block'];
 73:                 }
 74:             }
 75:             $this->_priceBlock[$productTypeId] = $this->getLayout()->createBlock($block);
 76:         }
 77:         return $this->_priceBlock[$productTypeId];
 78:     }
 79: 
 80:     /**
 81:      * Return template for Price Block renderer
 82:      *
 83:      * @param string $productTypeId Catalog Product type
 84:      * @return string
 85:      */
 86:     protected function _getPriceBlockTemplate($productTypeId)
 87:     {
 88:         if (isset($this->_priceBlockTypes[$productTypeId])) {
 89:             if ($this->_priceBlockTypes[$productTypeId]['template'] != '') {
 90:                 return $this->_priceBlockTypes[$productTypeId]['template'];
 91:             }
 92:         }
 93:         return $this->_priceBlockDefaultTemplate;
 94:     }
 95: 
 96:     /**
 97:      * Returns product price html for RSS feed
 98:      *
 99:      * @param Mage_Catalog_Model_Product $product
100:      * @param bool $displayMinimalPrice Display "As low as" etc.
101:      * @param string $idSuffix Suffix for HTML containers
102:      * @return string
103:      */
104:     public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix='')
105:     {
106:         $type_id = $product->getTypeId();
107:         if (Mage::helper('catalog')->canApplyMsrp($product)) {
108:             $type_id = $this->_mapRenderer;
109:         }
110: 
111:         return $this->_getPriceBlock($type_id)
112:             ->setTemplate($this->_getPriceBlockTemplate($type_id))
113:             ->setProduct($product)
114:             ->setDisplayMinimalPrice($displayMinimalPrice)
115:             ->setIdSuffix($idSuffix)
116:             ->setUseLinkForAsLowAs($this->_useLinkForAsLowAs)
117:             ->toHtml();
118:     }
119: 
120:     /**
121:      * Adding customized price template for product type, used as action in layouts
122:      *
123:      * @param string $type Catalog Product Type
124:      * @param string $block Block Type
125:      * @param string $template Template
126:      */
127:     public function addPriceBlockType($type, $block = '', $template = '')
128:     {
129:         if ($type) {
130:             $this->_priceBlockTypes[$type] = array(
131:                 'block' => $block,
132:                 'template' => $template
133:             );
134:         }
135:     }
136: }
137: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0