I have a bridge built between two applications, where products are getting dumped into magento. I am using Magento SOAP API to add/update/delete products, but i need to do delete product using SKU and not product id..Any Suggestions?
1 Answer
Hear the Code to remove the Product Based on SKU
Request Example SOAP V1
$client = new SoapClient('http://magentohost/api/soap/?wsdl');
// If somestuff requires api authentification,
// then get a session token
$session = $client->login('apiUser', 'apiKey');
$result = $client->call($session, 'catalog_product.delete', '1');
var_dump($result);
// If you don't need the session anymore
//$client->endSession($session);
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary
$result = $proxy->catalogProductDelete($sessionId, '6');
var_dump($result);
Please see the Image for Request and Response Data
For More Reference Please Check This Link.
-
-
Hi, what about product resources like "media files" - Are they also deleted from DB and/or filesystem ? Do you have any experiences about this topic ? Regards– domi27Oct 12, 2016 at 14:31