0
PrestaShop APIからカテゴリ名を取得しようとしています。 しかし、私はこのXMLオブジェクトを解析するのに失敗しています。私は値 "ルート"を取得したいが、私はこれを達成する方法を知らない。 PrestaShopのデータから、このデータを得ることができます。どのようにして "Root"値を取得できますか?PrestaShop:webserviceからカテゴリ名を取得
object(SimpleXMLElement)#5 (2) { ["@attributes"]=> array(1) { ["id"]=> string(1) "2" } [0]=> string(4) "Root" }
これは私のコードです:
$store_path = 'http://xxxx.com/';
$auth_key = 'xxxxxx';
$webService = new PrestaShopWebservice($store_path, $auth_key, false);
// The key-value array
$opt['resource'] = 'categories';
$opt['display'] = 'full';
$opt['limit'] = 10;
//Retrieving the XML data
$xml = $webService->get($opt);
var_dump($xml[0]->categories[0]->category->name->language[0][0]);
ルート値は何を意味するのですか? ID? – sarcom
質問で印刷した「ルート」文字列 –