Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Can i display attributes by group
 
DnD Thomas
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-09-26
 

hi there !!

maybe someone will be able to help me ?
Was wondering if i can display attribute by group , i mean when you create an attribute set u can drag an attribute in a group , by default u got group like “general” , “price” ; etc ...

in the attributes.phtml u call them by

$_additional $this->getAdditionalData()
but the problem is that, this code call all attributes

is there a way to call attribute by group
maybe something like :

$_group1 $this->getAttributeByGroup('something')
 
Magento Community Magento Community
Magento Community
Magento Community
 
grooves1200
Sr. Member
 
Total Posts:  122
Joined:  2008-02-01
 

i have the same question. i’d like to put together a “key specs” group for all attributes sets that would change from product type to product type. i’d then like to call key specs instead of the quick overview. any help would be appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Harmenk
Member
 
Avatar
Total Posts:  35
Joined:  2009-08-10
Loppersum
 

Hi there,

I also have te same question. Has anybody discovered something?

H.Kuijer

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeremie B
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2010-06-02
 

It’s an old post, but I was in the same situation, so I fixed it with this function :

In my case, the function is is class

<MyCompany>_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Block_Customer_Edit_Tab_Account
in app/local/<MyCompany>/Adminhtml/Block/Customer/Edit/Tab/Account.php

/**
     *     @param $customer // Current customer
     *     @param string $groupName
     *     @param int $attributeSetId
     *     @return Mage_Eav_Model_Entity_Attribute $attributes // Collection of attributes    
     */
public function getAttributesByGroup($customer$attributeSetId$groupName)
    
{
        $attributes 
= array();
        
$groupId 0;
        
        
// Load all groups contained in AttributesSet id = 1
        
$groupCollection    Mage::getResourceModel('eav/entity_attribute_group_collection')
            ->
setAttributeSetFilter($attributeSetId)
            ->
load();
            
         foreach (
$groupCollection as $group{
            
if($group->getAttributeGroupName() == $groupName){
                $groupId 
$group->getId();
                break;
            
}
        }
            
        $allAttributes 
$customer->getAttributes();
        foreach (
$allAttributes as $attribute{
            
/* @var $attribute Mage_Eav_Model_Entity_Attribute */
            
if ($attribute->isInGroup($attributeSetId$groupId)) {
                $attributes[] 
$attribute;
            
}
        }
        
        
return $attributes;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top