Get the latest products using magento APIs

I am trying to get the latest products (maximum 20) from the magento API using SOAP, I only need images and a link to the product, since they are displayed on another site.

I use the code below for this:

$client = new SoapClient('http://magentohost/api/soap/?wsdl'); $session = $client->login('username', 'password'); $apicalls = array(); $i = 0; $ii = 0; $filters = array('sku' => array('neq'=>'')); $products = $client->call($session, 'catalog_product.list',array($filters)); foreach ($products as $product){ $apicalls[$i] = array('catalog_product_attribute_media.list', $product['product_id']); $i++; $apicalls[$i] = array('catalog_product.info', $product['product_id']); $i++; } $productinfo = $client->multiCall($session, $apicalls); 

however the code above does not display images, any ideas

thanks for the help

+8
soap php magento
source share
1 answer

this code works. My bet is that you do not have product images selected in the role settings. Please check it out and let me know.

Web Service β†’ SOAP / XML-RPC - Roles β†’ Role Resources

From tree navigation and checking:

Catalog β†’ Product β†’ Product Images

+2
source share

All Articles