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

标签 php magento magento-1.7

我已经尝试了各种各样的事情,但我一无所获。请有人告诉我如何获取所有可用产品属性集的名称和 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/

相关文章:

php - 如何使用ckeditor更新php ajax中的textarea值?

bluehost 上的 php SESSION 变量

php - Magento 订单状态更改事件

玛根托 : How to hide the default Store View code from the url

php - Magento:根据客户群获取产品价格

php - 在文本框中保存 ' to database, i get\' 时

PHP/MySQL 查询 : Rows Not Being Inserted

php - magento - 快速搜索返回所有产品

magento - 哪个 CMS 与 magento 交互

magento - 无法在 Magento 中使用 TAX