Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在magento网站上获得亚马逊客户评论_Magento_Amazon Web Services_Amazon Ec2_Amazon_Magento 1.8 - Fatal编程技术网

如何在magento网站上获得亚马逊客户评论

如何在magento网站上获得亚马逊客户评论,magento,amazon-web-services,amazon-ec2,amazon,magento-1.8,Magento,Amazon Web Services,Amazon Ec2,Amazon,Magento 1.8,我想在我的magento网站上显示亚马逊客户评论。。。 我搜索了很多,找到了一些链接,这些链接向我展示了这方面的步骤 <iframe src="http://www.amazon.com/reviews/iframe?akid=[AWS Access Key ID]&asin=0316067938&exp=2011-08-01T17%3A54%3A07Z&linkCode=xm2&summary=0&tag=ws&truncate=256&a

我想在我的magento网站上显示亚马逊客户评论。。。 我搜索了很多,找到了一些链接,这些链接向我展示了这方面的步骤

<iframe src="http://www.amazon.com/reviews/iframe?akid=[AWS Access Key ID]&asin=0316067938&exp=2011-08-01T17%3A54%3A07Z&linkCode=xm2&summary=0&tag=ws&truncate=256&v=2&sig=[Signature]" /> 

在此iframe中,AWSAccessKeyId签名使用。。。。我获得了AWSAccessKeyId,但尚未找到签名


因此,请您告诉我,从哪里可以获得亚马逊的签名密钥。

我们可以使用 。通过使用此类,应用程序将根据其ISBN号生成一个指向亚马逊页面的URL,该页面上仅包含评论

代码

# see comment above about 10 and 13 digit ISBNs 
if($reviews = getAmazonReviews($book['ISBN_10'])) 
{
  $amazonReviewsIframe = $reviews;
} 
else 
{
  $asin = isbnToAsin($book['ISBN_13']);
  $amazonReviewsIframe = getAmazonReviews($asin); 
}


if($amazonReviewsIframe) 
{
 echo "<a class='fboxEdit' href='$amazonReviewsIframe'>Amazon</a>";
}

 # get the first two values from the Product Advertising API, 
 # last 2 values are needed for Amazon-ECS-PHP-Library
 define("API_KEY",         "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
 define("API_SECRET",      "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
 define("COUNTRY_CODE",    "com");
 define("ASSOC_TAG",       "myrealis");


 function amazonApi() 
 {
   # https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/master/lib/AmazonECS.class.php
   require_once 'AmazonECS.class.php'; 
   $client = new AmazonECS(API_KEY, API_SECRET, COUNTRY_CODE, ASSOC_TAG);                                                                
   return $client;
 }

 function getAmazonReviews($asin) 
 {
  $client = amazonApi();
  $response = $client->category('Books')->responseGroup('Reviews')->search($asin);

  if($response->Items->Item->ASIN == $asin) 
  {
   return $response->Items->Item->CustomerReviews->IFrameURL;
  } 
  else 
  {
   return False;
  }
  }

  function isbnToAsin($isbn)
  {
    $client = amazonApi();

    # I extended the AmazonECS.class with the "lookupIsbn" function
    $response  = $client->category('Books')->lookupIsbn($isbn);

     if(isset($response->Items->Item->ASIN)) {
       return $response->Items->Item->ASIN;
     } else {
       return False;
     }
  }


    # added inside the AmazonECS.class

    public function lookupIsbn($isbn) 
   {
     $params = $this->buildRequestParams('ItemLookup', array(
'ItemId' => $isbn, 'IdType' => 'ISBN', 'SearchIndex' => 'Books'
     ));

     return $this->returnData(
     $this->performSoapRequest("ItemLookup", $params)
     );
   }
#请参见上面关于10位和13位ISBN的评论
如果($reviews=getAmazonReviews($book['ISBN_10']))
{
$amazonReviewsIframe=$reviews;
} 
其他的
{
$asin=isbnToAsin($book['ISBN_13']);
$amazonReviewsIframe=getAmazonReviews($asin);
}
if($amazonReviewsIframe)
{
回声“;
}
#从产品广告API中获取前两个值,
#Amazon ECS PHP库需要最后2个值
定义(“API_密钥”、“XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”);
定义(“API_机密”、“XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”);
定义(“国家/地区代码”、“com”);
定义(“关联标签”、“myrealis”);
函数amazonApi()
{
# https://github.com/Exeu/Amazon-ECS-PHP-Library/blob/master/lib/AmazonECS.class.php
需要一次'AmazonECS.class.php';
$client=newamazonecs(API_密钥、API_秘密、国家代码、关联标签);
返回$client;
}
功能getAmazonReviews($asin)
{
$client=amazonApi();
$response=$client->category('Books')->responseGroup('Reviews')->search($asin);
如果($response->Items->Item->ASIN==$ASIN)
{
返回$response->Items->Item->CustomerReviews->IFrameURL;
} 
其他的
{
返回False;
}
}
函数isbnToAsin($isbn)
{
$client=amazonApi();
#我用“lookupIsbn”函数扩展了AmazonECS.class
$response=$client->category('Books')->lookupIsbn($isbn);
如果(设置($response->Items->Item->ASIN)){
返回$response->Items->Item->ASIN;
}否则{
返回False;
}
}
#添加到AmazonECS.class中
公共功能查找isbn($isbn)
{
$params=$this->buildRequestParams('ItemLookup',数组(
'ItemId'=>isbn美元,'IdType'=>isbn','SearchIndex'=>Books'
));
return$this->returnData(
$this->performSoapRequest(“ItemLookup”,$params)
);
}
有关详细信息,请查看此链接