_priceBlock[$productTypeId])) { $block = $this->_priceBlockDefaultType; if (isset($this->_priceBlockTypes[$productTypeId])) { if ($this->_priceBlockTypes[$productTypeId]['block'] != '') { $block = $this->_priceBlockTypes[$productTypeId]['block']; } } $this->_priceBlock[$productTypeId] = $this->getLayout()->createBlock($block); } return $this->_priceBlock[$productTypeId]; } /** * Return template for Price Block renderer * * @param string $productTypeId Catalog Product type * @return string */ protected function _getPriceBlockTemplate($productTypeId) { if (isset($this->_priceBlockTypes[$productTypeId])) { if ($this->_priceBlockTypes[$productTypeId]['template'] != '') { return $this->_priceBlockTypes[$productTypeId]['template']; } } return $this->_priceBlockDefaultTemplate; } /** * Returns product price html for RSS feed * * @param Mage_Catalog_Model_Product $product * @param bool $displayMinimalPrice Display "As low as" etc. * @param string $idSuffix Suffix for HTML containers * @return string */ public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix='') { $type_id = $product->getTypeId(); if (Mage::helper('catalog')->canApplyMsrp($product)) { $type_id = $this->_mapRenderer; } return $this->_getPriceBlock($type_id) ->setTemplate($this->_getPriceBlockTemplate($type_id)) ->setProduct($product) ->setDisplayMinimalPrice($displayMinimalPrice) ->setIdSuffix($idSuffix) ->setUseLinkForAsLowAs($this->_useLinkForAsLowAs) ->toHtml(); } /** * Adding customized price template for product type, used as action in layouts * * @param string $type Catalog Product Type * @param string $block Block Type * @param string $template Template */ public function addPriceBlockType($type, $block = '', $template = '') { if ($type) { $this->_priceBlockTypes[$type] = array( 'block' => $block, 'template' => $template ); } } }