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