To use soap api to add a products of categories into root category , first we need to create a magento user with the permission to access the api. 
Following code will be use to set products to root category
$soap = new SoapClient('http://magentosetup/api/v2_soap/?wsdl'); 
$sessionId = $soap->login('User', 'Key'); 
$result = $soap->catalogCategoryAssignProduct($sessionId, 'root_category_id', 'product_id');
This will be executed in loop for all products to get the product id and root category id. 
                       
                    
0 Comment(s)