2011-08-30 3 views
0

magentoで独自のアトリビュートセットを作成しましたが、多数のオプション値を持つ「MyAttribSet」としましょう。
これらの値を取得して、単純なプロダクトをそれぞれプログラムに割り当てる/作成するにはどうすればよいですか? I found code sample here, but I'm missing the latter part with option values:シンプルな製品を作成してオプションの値をmagentoにアトリビュートする方法

私はMagentoのバージョンを使用していますが、1.5.0.1

答えて

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']); 
} 
+0

受け入れ、それはstackoverflowのルールで許可されているとさえ示唆しているとして、あなた自身の答えをマークしてください。 – Zyava

関連する問題