Mage_Catalog_Block_Product_View_Attributes Class Reference

Inheritance diagram for Mage_Catalog_Block_Product_View_Attributes:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getProduct ()
 getAdditionalData (array $excludeAttr=array())

Protected Attributes

 $_product = null


Detailed Description

Definition at line 35 of file Attributes.php.


Member Function Documentation

getAdditionalData ( array excludeAttr = array()  ) 

$excludeAttr is optional array of attribute codes to exclude them from additional data array

Parameters:
array $excludeAttr
Returns:
array

Definition at line 54 of file Attributes.php.

00055     {
00056         $data = array();
00057         $product = $this->getProduct();
00058         $attributes = $product->getAttributes();
00059         foreach ($attributes as $attribute) {
00060 //            if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
00061             if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
00062 
00063                 $value = $attribute->getFrontend()->getValue($product);
00064 
00065                 // TODO this is temporary skipping eco taxes
00066                 if (is_string($value)) {
00067                     if (strlen($value) && $product->hasData($attribute->getAttributeCode())) {
00068                         if ($attribute->getFrontendInput() == 'price') {
00069                             $value = Mage::app()->getStore()->convertPrice($value,true);
00070                         } elseif (!$attribute->getIsHtmlAllowedOnFront()) {
00071                             $value = $this->htmlEscape($value);
00072                         }
00073                         $data[$attribute->getAttributeCode()] = array(
00074                            'label' => $attribute->getFrontend()->getLabel(),
00075                            'value' => $value,
00076                            'code'  => $attribute->getAttributeCode()
00077                         );
00078                     }
00079                 }
00080             }
00081         }
00082         return $data;
00083     }

getProduct (  ) 

Definition at line 39 of file Attributes.php.

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


Member Data Documentation

$_product = null [protected]

Definition at line 37 of file Attributes.php.


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

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