我需要从api获取路径和参考号。我有工作解决方案显示在那里,但它加载了太多的数据,这需要时间。可能是因为$opt = array('resource' => 'products','display' => 'full');
Prestashop - API只获取选定的值而不是“display = full”
$opt = array('resource' => 'products',
'display' => 'full');
$xml = $webService->get($opt);
$productNodes = $xml->products->children();
$products = array();
foreach ($productNodes as $product) {
$reference = (string) $product->reference;
$path = $url.'/index.php?controller=product&id_product=' . $product->id;
$products[] = array('reference' => $reference, 'path' => $path);
}
它,我发现that I can obtain only needed tables,但它不工作的reference
和path
表,或可能有人告诉我有什么不对?
$opt = array('resource' => 'products',
'display' => '[reference,path]');
它返回以下错误:
未捕获的异常“PrestaShopWebserviceException”有消息“这调用的Prestashop Web服务失败并返回400 HTTP状态这意味着:坏请求
非常感谢你的帮助。
你说得对,应该有身份证,我已经混在一起了,非常感谢! –