如何获取属于magento中的属性组的所有属性 [英] how to get the all attributes that belongs to a attribute group in magento

查看:72
本文介绍了如何获取属于magento中的属性组的所有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个属性组,我想获取属于特定属性组的属性列表.有什么办法可以将所有属性归入属性组?

I have an attribute group and I want to get the list of attributes that belongs a particular attribute group. Is there any way to get all of the attributes under an attribute group?

推荐答案

适用于Mage 1.7.0.0:

Works on Mage 1.7.0.0:

function printGroupAttributes($groupId) {
    $attributesCollection = Mage::getResourceModel('catalog/product_attribute_collection');
        $attributesCollection->setAttributeGroupFilter($groupId);
        foreach ($attributesCollection as $attribute) {
           echo $attribute->getAttributeCode()."<br/>"; // I launch it from browser
        }
}
$attributeGroupId = 534; // Fill with yours
printGroupAttributes($attributeGroupId);

来源:Mage_Catalog_Model_Product_Attribute_Group->hasConfigurableAttributes()

这篇关于如何获取属于magento中的属性组的所有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆