Public Member Functions | |
getProduct () | |
getAdditionalData (array $excludeAttr=array()) | |
Protected Attributes | |
$_product = null |
Definition at line 35 of file Attributes.php.
$excludeAttr is optional array of attribute codes to exclude them from additional data array
array | $excludeAttr |
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 }
$_product = null [protected] |
Definition at line 37 of file Attributes.php.