Mage_Checkout_Block_Cart_Totals Class Reference

Inheritance diagram for Mage_Checkout_Block_Cart_Totals:

Mage_Checkout_Block_Cart_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getTotals ()
 setTotals ($value)
 renderTotal ($total, $area=null, $colspan=1)
 renderTotals ($area=null, $colspan=1)

Protected Member Functions

 _getTotalRenderer ($code)

Protected Attributes

 $_totalRenderers
 $_defaultRenderer = 'checkout/total_default'
 $_totals = null


Detailed Description

Definition at line 27 of file Totals.php.


Member Function Documentation

_getTotalRenderer ( code  )  [protected]

Definition at line 48 of file Totals.php.

00049     {
00050         if (!isset($this->_totalRenderers[$code])) {
00051             $this->_totalRenderers[$code] = $this->_defaultRenderer;
00052             $config = Mage::getConfig()->getNode("global/sales/quote/totals/{$code}/renderer");
00053             if ($config)
00054                 $this->_totalRenderers[$code] = (string) $config;
00055 
00056             $this->_totalRenderers[$code] = $this->getLayout()->createBlock($this->_totalRenderers[$code], "{$code}_total_renderer");
00057         }
00058 
00059         return $this->_totalRenderers[$code];
00060     }

getTotals (  ) 

Reimplemented from Mage_Checkout_Block_Cart_Abstract.

Definition at line 34 of file Totals.php.

00035     {
00036         if (is_null($this->_totals)) {
00037             return parent::getTotals();
00038         }
00039         return $this->_totals;
00040     }

renderTotal ( total,
area = null,
colspan = 1 
)

Definition at line 62 of file Totals.php.

00063     {
00064         $code = $total->getCode();
00065         if ($total->getAs()) {
00066             $code = $total->getAs();
00067         }
00068         return $this->_getTotalRenderer($code)
00069             ->setTotal($total)
00070             ->setColspan($colspan)
00071             ->setRenderingArea(is_null($area) ? -1 : $area)
00072             ->toHtml();
00073     }

renderTotals ( area = null,
colspan = 1 
)

Definition at line 75 of file Totals.php.

00076     {
00077         $html = '';
00078 
00079         foreach($this->getTotals() as $total) {
00080             if ($total->getArea() != $area && $area != -1) {
00081                 continue;
00082             }
00083 
00084             $html .= $this->renderTotal($total, $area, $colspan);
00085         }
00086 
00087         return $html;
00088     }

setTotals ( value  ) 

Definition at line 42 of file Totals.php.

00043     {
00044         $this->_totals = $value;
00045         return $this;
00046     }


Member Data Documentation

$_defaultRenderer = 'checkout/total_default' [protected]

Definition at line 30 of file Totals.php.

$_totalRenderers [protected]

Definition at line 29 of file Totals.php.

$_totals = null [protected]

Reimplemented from Mage_Checkout_Block_Cart_Abstract.

Definition at line 32 of file Totals.php.


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

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