2
내 코드는 여기에 있지만 제 3 자 판매자로부터 최저 가격을 반환합니다. 내가 잘못하고있는 것은 무엇입니까? 응답 그룹 오퍼를 사용 중이므로 문서에 따라 결과를 얻는 방법입니다.amazon merchantID에 대해서만 amazon API 제품 가격을 검색하는 방법
function getAmazonPrice($region, $asin) {
$xml = aws_signed_request($region, array(
"Operation" => "ItemLookup",
"ItemId" => $asin,
"IncludeReviewsSummary" => False,
"ResponseGroup" => "Medium, Offers",
"MerchantId" => "Amazon",
));
$item = $xml->Items->Item;
$title = htmlentities((string) $item->ItemAttributes->Title);
$url = htmlentities((string) $item->DetailPageURL);
$image = htmlentities((string) $item->MediumImage->URL);
$price = htmlentities((string) $item->OfferSummary->LowestNewPrice->Amount);
$code = htmlentities((string) $item->OfferSummary->LowestNewPrice->CurrencyCode);
$qty = htmlentities((string) $item->OfferSummary->TotalNew);
if ($qty !== "0") {
$response = array(
"code" => $code,
"price" => number_format((float) ($price/100), 2, '.', ''),
"image" => $image,
"url" => $url,
"title" => $title
);
}
return $response;
}