Mage_Catalog_Block_Product_Price Class Reference

Inheritance diagram for Mage_Catalog_Block_Product_Price:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_Bundle_Block_Catalog_Product_Price Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Checkbox Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select

List of all members.

Public Member Functions

 getProduct ()
 getDisplayMinimalPrice ()
 setIdSuffix ($idSuffix)
 getIdSuffix ()
 getTierPrices ($product=null)

Protected Attributes

 $_priceDisplayType = null
 $_idSuffix = ''


Detailed Description

Definition at line 34 of file Price.php.


Member Function Documentation

getDisplayMinimalPrice (  ) 

Definition at line 48 of file Price.php.

00049     {
00050         return $this->_getData('display_minimal_price');
00051     }

getIdSuffix (  ) 

Definition at line 59 of file Price.php.

00060     {
00061         return $this->_idSuffix;
00062     }

getProduct (  ) 

Reimplemented in Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option.

Definition at line 39 of file Price.php.

00040     {
00041         $product = $this->_getData('product');
00042         if (!$product) {
00043             $product = Mage::registry('product');
00044         }
00045         return $product;
00046     }

getTierPrices ( product = null  ) 

Get tier prices (formatted)

Parameters:
Mage_Catalog_Model_Product $product
Returns:
array

Definition at line 70 of file Price.php.

00071     {
00072         if (is_null($product)) {
00073             $product = $this->getProduct();
00074         }
00075         $prices  = $product->getFormatedTierPrice();
00076 
00077         $res = array();
00078         if (is_array($prices)) {
00079             foreach ($prices as $price) {
00080                 $price['price_qty'] = $price['price_qty']*1;
00081 
00082                 if ($product->getPrice() != $product->getFinalPrice()) {
00083                     $productPrice = $product->getFinalPrice();
00084                 } else {
00085                     $productPrice = $product->getPrice();
00086                 }
00087 
00088                 if ($price['price']<$productPrice) {
00089                     $price['savePercent'] = ceil(100 - (( 100/$productPrice ) * $price['price'] ));
00090                     $price['formated_price'] = Mage::app()->getStore()->formatPrice(Mage::app()->getStore()->convertPrice(Mage::helper('tax')->getPrice($product, $price['website_price'])));
00091                     $price['formated_price_incl_tax'] = Mage::app()->getStore()->formatPrice(Mage::app()->getStore()->convertPrice(Mage::helper('tax')->getPrice($product, $price['website_price'], true)));
00092 
00093                     $res[] = $price;
00094                 }
00095             }
00096         }
00097 
00098         return $res;
00099     }

setIdSuffix ( idSuffix  ) 

Definition at line 53 of file Price.php.

00054     {
00055         $this->_idSuffix = $idSuffix;
00056         return $this;
00057     }


Member Data Documentation

$_idSuffix = '' [protected]

Definition at line 37 of file Price.php.

$_priceDisplayType = null [protected]

Definition at line 36 of file Price.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:36 2009 for Magento by  doxygen 1.5.8