aneeb 1 Posted November 21, 2012 Report 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.... Quote Link to post Share on other sites
justsomeguy 1,135 Posted November 21, 2012 Report Share Posted November 21, 2012 Where's the documentation for the API that you're using? Quote Link to post Share on other sites
aneeb 1 Posted November 21, 2012 Author Report 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. Quote Link to post Share on other sites
justsomeguy 1,135 Posted November 21, 2012 Report 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? Quote Link to post Share on other sites
aneeb 1 Posted November 21, 2012 Author Report 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 Quote Link to post Share on other sites
justsomeguy 1,135 Posted November 21, 2012 Report Share Posted November 21, 2012 Try these: 'additional_attributes' => array( 'user' => 'aneeb') 'additional_attributes' => array( 'single_data' => array( array('key' => 'user', 'value' => 'aneeb') )) Quote Link to post Share on other sites
aneeb 1 Posted November 21, 2012 Author Report Share Posted November 21, 2012 the code works.. :rolleyes:Thank you sir thanks alot for your help. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.