gpt4 book ai didi

php - Magento 从外部脚本中获取可用的属性集 ID 和名称

转载 作者:可可西里 更新时间:2023-11-01 13:10:23 24 4
gpt4 key购买 nike

我已经尝试了各种各样的事情,但我一无所获。请有人告诉我如何获取所有可用产品属性集的名称和 ID?一个将是“默认”...

我正在构建一个自定义报价系统,需要引入属性集,以便用户可以先选择它,然后加载分配给该集的产品。

非常感谢您的帮助。

最佳答案

您可以加载属性集:

$attributeSetCollection = Mage::getResourceModel('eav/entity_attribute_set_collection') ->load();

迭代:

foreach ($attributeSetCollection as $id=>$attributeSet) {
$entityTypeId = $attributeSet->getEntityTypeId();
$name = $attributeSet->getAttributeSetName();
Mage::log("ATTRIBUTE SET :".$name." - ".$id);
}

然后您可以通过属性集加载您的集合。

关于php - Magento 从外部脚本中获取可用的属性集 ID 和名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12176298/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com