我使用外部 prestashop 网络服务来检索产品例如,我如何恢复此标题的数量等...
$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"}"
这有效:
$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];