/** * add attributes */ public function setAttributeGroups() { parent::setAttributeGroups($this->getAdditionalInfo('attribute_groups')); }
/** * set attribute groups */ public function setAttributeGroups() { if ($this->item->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) { $productTypeInstance = $this->item->getTypeInstance(true); if ($productTypeInstance == null || !method_exists($productTypeInstance, "getUsedProducts")) { return; } $configurableAttributes = $productTypeInstance->getConfigurableAttributes($this->item); $result = array(); foreach ($configurableAttributes as $attribute) { /* @var $attribute Mage_Catalog_Model_Product_Type_Configurable_Attribute */ $attributeItem = new Shopgate_Model_Catalog_AttributeGroup(); $attributeItem->setUid($attribute->getAttributeId()); $attributeItem->setLabel($attribute->getProductAttribute()->getStoreLabel()); $result[] = $attributeItem; } parent::setAttributeGroups($result); } }