Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problem with Adding Product Using Magento API
 
ayasoftware
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2009-06-02
 

Hello,

I’m trying to add products using the magento API.
The following code once executed saves information into magento system,
But manufacturer has no value.

The NIKE value is already in the manufacturer’s Label/Optios List

<?php
error_reporting
(E_ALL);
ini_set("display_errors"1); 

$proxy = new SoapClient('http://example.com/index.php/api/soap/?wsdl');
$sessionId $proxy->login($username$key);

$attributeSets $proxy->call($sessionId'product_attribute_set.list');
$set current($attributeSets);

$sku"123890";

$newProductData = array(
'name'                     => "Product name",
'websites'                 => array(1),
'short_description'     => "short description ",
'description'               => "long description",
'price'                          => 120.50,
'category_ids'             => '3,6',
'meta_description'         => "meta description",
'manufacturer'              => 'Nike',
'status'                     => '1',
'tax_class_id'          => 'None'

);
$proxy->call($sessionId'product.create', array('simple'$set['set_id'],  $sku$newProductData)); 


?>

Please help me resolve this issue


Thank you!
 
Magento Community Magento Community
Magento Community
Magento Community
 
jpic
Jr. Member
 
Total Posts:  4
Joined:  2009-06-19
 

It works for me when using the manufacturer option id (a number) instead of value.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top