0
我在magento中创建了自己的属性集,比如说带有大量选项值的“MyAttribSet”。
如何检索这些值并以编程方式为每个人分配/创建一个简单的产品? I found code sample here, but I'm missing the latter part with option values:如何在magento中创建简单的产品属性选项值
我使用的Magento版本1.5.0.1
我在magento中创建了自己的属性集,比如说带有大量选项值的“MyAttribSet”。
如何检索这些值并以编程方式为每个人分配/创建一个简单的产品? I found code sample here, but I'm missing the latter part with option values:如何在magento中创建简单的产品属性选项值
我使用的Magento版本1.5.0.1
我解决了这个问题:
require_once 'app/Mage.php';
Mage::app('');
$attribute = Mage::getModel('eav/config')
->getAttribute('catalog_product', '955');
foreach ($attribute->getSource()->getAllOptions(true) as $option){
//here comes the code sample (see link before)
.
.
.
$product->setMyCustomAttribute($option['value']);
}
请注明自己的答案被接受,它是允许的,甚至是计算器的规则建议。 – Zyava