aneeb Posted November 21, 2012 Share Posted November 21, 2012 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.... Link to comment Share on other sites More sharing options...
justsomeguy Posted November 21, 2012 Share Posted November 21, 2012 Where's the documentation for the API that you're using? Link to comment Share on other sites More sharing options...
aneeb Posted November 21, 2012 Author Share Posted November 21, 2012 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. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 21, 2012 Share Posted November 21, 2012 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? Link to comment Share on other sites More sharing options...
aneeb Posted November 21, 2012 Author Share Posted November 21, 2012 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 Link to comment Share on other sites More sharing options...
justsomeguy Posted November 21, 2012 Share Posted November 21, 2012 Try these: 'additional_attributes' => array( 'user' => 'aneeb') 'additional_attributes' => array( 'single_data' => array( array('key' => 'user', 'value' => 'aneeb') )) Link to comment Share on other sites More sharing options...
aneeb Posted November 21, 2012 Author Share Posted November 21, 2012 the code works.. :rolleyes:Thank you sir thanks alot for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now