我在PHP中使用亚马逊API。
我需要列出产品的类别( root browsenodes )。
Ex. men fashion women fashion kitchen baby&kids
因为这无法找到解决方案。
产品上的搜索功能正常。
我已将这些文件包含在搜索产品中:
amazon_api_class.php,aws_signed_request.php
我使用以下功能获取搜索结果
文件名:amazon_api_class.php
public function searchProducts($search, $category, $searchType = "UPC")
{
$allowedTypes = array("UPC", "TITLE", "ARTIST", "KEYWORD");
$allowedCategories = array("Music", "DVD", "VideoGames", "Apparel", "Automotive", "Baby" ,"Beauty", "Books",
"Classical", "DigitalMusic", "Electronics", "HealthPersonalCare", "HomeGarden", "Industrial", "Jewelry",
"Kitchen", "Magazines", "Miscellaneous", "OfficeProducts", "Video", "Watches");
switch($searchType)
{
case "UPC" : $parameters = array("Operation" => "ItemLookup",
"ItemId" => $search,
"SearchIndex" => $category,
"IdType" => "UPC",
"ResponseGroup" => "Medium");
break;
case "TITLE" : $parameters = array("Operation" => "ItemSearch",
"Title" => $search,
"SearchIndex" => $category,
"ResponseGroup" => "Medium");
break;
}
$xml_response = $this->queryAmazon($parameters);
return $this->verifyXmlResponse($xml_response);
}
现在我正在寻找一个这样的函数,它将在xml响应中提供可用的类别。