0
Magento Soap API를 통해 구성 가능한 새 제품을 작성하고 관련 제품을 추가해야합니다.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)));
mant thx.