【发布时间】:2013-01-11 16:42:14
【问题描述】:
我花了几个小时试图弄清楚但失败了。我需要在 Magento 中为“制造商”属性提取标签和值。但我需要获取管理字段中的描述 - 而不是特定于商店的描述。
我找到了很多方法来获取特定于商店的信息,我也可以提取属性的所有选项,但不能只从产品页面中获取当前文章 + 管理值 + 管理标签的组合(无论我从哪个商店访问它)。
有人可以帮忙吗?
这给出了所有值+标签的数组,但不适用于具体文章:
<pre><code>
$attribute = $_product->getResource()->getAttribute('manufacturer');
foreach ( $attribute->getSource()->getAllOptions(true, true) as $option){
$attributeArray[$option['value']] = $option['label'];
}
</code></pre>
【问题讨论】:
标签: php magento attributes label admin