我使用外部prestashop Web服务检索产品 示例我如何才能恢复此标题的数量等...
$productResources = $webService->get(array('resource' => 'products','active' => '0', 'id' => (int)$product_id));
$productWB = $productResources->product;
echo $productWB->name->language;
result = "{"@attributes":{"id":"2"},"0":"Pantalon de costume - Bleu-Ile de Paques"}"
答案 0 :(得分:1)
这有效:
$productResources = $webService->get(array('resource' => 'products','active' => '0', 'id' => (int)$product_id));
$productWB = $productResources->product;
$productb = get_object_vars(json_decode($productWB->name->language));
echo $productb[0];