Jump to content
Sign in to follow this  
aneeb

Enter data in additional attribute through API in magento shop

Recommended Posts

Hey everyone! i am trying to enter data in additional attribute through API in magento shop.I have tried this code but it is not working the data is not entering..

  'additional_attributes' => array   (   array(			'key' => 'user',			'value' => 'aneeb'))

Please tell me what i am doing wrong or tell me how can i enter data in additional attributes through API in magento shop....

Share this post


Link to post
Share on other sites

I am using SOAP API for entering products in magento shops.here is the full code..

$client = new SoapClient('http://localhost/magento/api/v2_soap/?wsdl');$session = $client->login('apiKey', 'apiValue');$attributeSets = $client->catalogProductAttributeSetList($session);$attributeSet = current($attributeSets);$result = $client->catalogProductCreate($session, 'simple', $attributeSet->set_id, $sku, array(    'categories' => array($category),    'websites' => array(1),'user' => array($username),    'name' => $name,    'description' => $desc,    'short_description' => $short_desc,    'weight' => $weight,    'status' => '1',    'url_key' => 'test product-url-key',    'url_path' => 'test product-url-path',    'visibility' => '4',    'price' => $price,    'tax_class_id' => 1,    'meta_title' => 'Product',    'meta_keyword' => 'Product meta keyword',    'meta_description' => 'Product meta description',  'additional_attributes' => array   (   array('key' => 'user', 'value' => 'aneeb'))));var_dump ($result);

the other values are entering properly but the additional attribute value is not working.

Share this post


Link to post
Share on other sites

Are you reading the documentation for the API? I'm trying to find out where in the documentation is says how to add attributes. What documentation are you using?

Share this post


Link to post
Share on other sites

here is the link for entering products through API.http://www.magentocommerce.com/api/soap/catalog/catalogProduct/catalog_product.create.html check Request Example SOAP V2

Share this post


Link to post
Share on other sites

Try these:

'additional_attributes' => array(  'user' => 'aneeb')

'additional_attributes' => array(  'single_data' => array(    array('key' => 'user', 'value' => 'aneeb')  ))

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...