如何获得Magento站点亚马逊顾客评分亚马逊、如何获得、顾客、评分

2023-09-11 09:39:09 作者:丶贩卖思念

我想告诉我的Magento站点亚马逊客户评价...... 我搜索了很多,我发现了一些链接这显示出我的步骤,这......

i want to show the amazon customer review on my magento site ... i searched a lot and i found some links which showing me the steps for this..

<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,但我还没有发现在签名。

In this iframe AWSAccessKeyId and Signature is using .... i got the AWSAccessKeyId but i haven't found the Signature.

所以请你能告诉我,从那里我得到亚马逊的签名密钥。

so please can you tell me, from where i get the Signature key of amazon.

推荐答案

我们可以很容易地得到了客户的审查通过的亚马逊ECS-PHP库 。通过使用这个类的应用程序生成一个URL到亚马逊页面,只有在它的评论,是根据它的ISBN号码。

We can easily get the customer review by using Amazon-ECS-PHP-Library .By Using this class the app generates an URL to an Amazon page with only the reviews on it , based on its ISBN number.

在code

# 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)
     );
   }

请检查此链接,了解更多详情。显示在您的网站与商品广告API 亚马逊书评

Please check this link, for more details.. Show Amazon book reviews on your site with the Product Advertising API