首页 文章

如何使用magento api创建可配置产品?

提问于
浏览
9

如何使用Magento api创建可配置产品?

4 回答

  • 3

    Here's这是一个非常好的教程,可以指导您修补API,因此您可以直接使用API创建可配置产品,并为其分配简单的产品 .

    祝好运

  • 4

    复制/粘贴自http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product#example_2._product_createviewupdatedelete

    $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
    $sessionId = $proxy->login('apiUser', 'apiKey');
    
    // default attribute set in my install is 4
    $attribute_set_id = 4;
    
    // configurable product to create
    $product_sku = 123456789012;
    
    $newProductData = array(
       'name'              => 'name of product',
       // websites - Array of website ids to which you want to assign a new product
      'websites'          => array(1), // array(1,2,3,...)
      'short_description' => 'short description',
      'description'       => 'description',
      'price'             => 12.05
    );
    
    $proxy->call($sessionId, 'product.create', array(
      'configurable', 
      $attribute_set_id, 
      $product_sku, 
      $newProductData
    ));
    

    困难的部分是为您的配置分配简单的产品(不支持通过api) . 这是method for assigning simples to configurables directly

  • 4

    这可以通过magento-improve-api插件实现 . 如果您需要控制可配置产品可配置的属性,则需要使用该插件中的一个分支 .

  • 0

    您使用API创建可配置产品的问题 - 答案是:您不能 . 它不支持它(至少是 . )

相关问题