使用Soap API将Magento属性设置为可配置产品

我需要通过Magento Soap API创建一个新的可配置产品,并为其添加相关产品。 我使用这个代码创建2个产品(一个简单和一个配置。)然后我尝试将简单的一个链接到配置一...这不起作用.. 有一个教程可以做到吗? 任何帮助? 非常感谢。
// Magento login information 
    $mage_url = 'http://test.de/api/?wsdl'; 
    $mage_user = 'admin'; 
    $mage_api_key = 'admin'; 
    // Initialize the SOAP client 
    $soap = new SoapClient( $mage_url ); 
    // Login to Magento 
    $session = $soap->login( $mage_user, $mage_api_key );



    $attributeSets = $soap->call($session,'product_attribute_set.list');
    $set = current($attributeSets);

    $sku = 'iphone-12345';

    //configurable

    $newProductData = array(
        'name'              => 'iPhone',
        'websites'          => array(1),
        'short_description' => 'short description',
        'description'       => 'description',
        'price'             => 150,
        'status'            => '1',
        'categories'    => array(138),
    );



    $newProductRelated = array(

        'name'              => 'iPhone',
        'websites'          => array(1),
        'short_description' => 'short description',
        'description'       => 'description',
        'price'             => 150,
        'status'            => '1',
        'sku'               => '2551464'
            );



    $productId = $soap->call($session,'product.create',array('configurable', $set['set_id'], $sku ,$newProductData));
    $productId2 = $soap->call($session,'product.create',array('simple', $set['set_id'], $newProductRelated['sku'] ,$newProductRelated));




    $soap->call($session, 'product_link.assign', array('configurable', $sku, $newProductRelated['sku'], array('position'=>0, 'colore'=> 21, 'qty'=>6)));
再来一次。     
已邀请:
处理类似问题并使用CSV导入来创建从API导入的产品的关系。这可能是通过生成的CSV一次导入的可用方法。     

要回复问题请先登录注册