Magento API – Get Product Details

Posted by: Karen Wednesday, October 24th, 2012

I was writing a little code snippet tonight to get the name and url for products in a particular category. Its quite simple to do with the Magento API, here is the code:

$proxy = new SoapClient($soapUrl.'api/soap?wsdl');
$sessionId = $proxy->login($apiUser, $apiPass);
$productArr = $proxy->call($sessionId,
                   'catalog_category.assignedProducts', array('33'));
foreach ($productArr as $product) {
  $productListing = $proxy->call($sessionId, '', $product['sku']);
  $extnDetails[] = array (
         'url' =>''.$productListing['url_path']

The output is something like:

[name] => Nike Shoes      [url] => )
[name] => Adidas Trainers [url] => )

Tags: , , ,

Leave a Reply