我正在尝试使用SOAP从magento API获取最新产品(最多20个),我只需要图像和产品链接,因为它们正在另一个站点上显示.
原文链接:https://www.f2er.com/php/136257.html我正在使用以下代码来做到这一点:
$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);
谢谢您的帮助