How to create configurable product using magento api?
Asked Answered
F

4

9

How can I create a configurable product using the Magento api?

Fionafionna answered 26/4, 2011 at 12:35 Comment(1)
Here is an extension that can help: johannreinke.com/en/2012/04/20/… After installation, you just have to specify a key "associated_skus" to the configurable product and simple products will be associated automatically.Kaolin
M
4

Your question of creating a configurable product using the API - the answer is: You can't. It doesn't support it (yet at least.)

Mason answered 26/4, 2011 at 22:2 Comment(1)
two and a half years later and still not yet. It's almost as if the "bizarre" want us to get plugins :) Almost.Erythro
M
4

This is possible with the magento-improve-api plugin. If you need to control which attributes your configurable product is configurable across, you'll need one of the forks of that plugin in

Margrettmarguerie answered 22/5, 2013 at 12:27 Comment(0)
M
3

Here's a really good tutorial that walks you through patching the API, so you can use the API directly to create the configurable product, and assign simple products to it as well.

Good luck

Melburn answered 15/5, 2011 at 16:43 Comment(0)
E
0

Copy/pasted from 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
));

The hard part is assigning simple products to your configurables (not supported via the api). Here's a method for assigning simples to configurables directly

Evenings answered 26/4, 2011 at 19:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.