END;
//the category could also come from a GET if you wanted.
$category = "All";
define('AWS_API_KEY', 'AKIAI3EEB5HKFHQUZAAA');
define('AWS_API_SECRET_KEY', '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');
define('AWS_ASSOCIATE_ID', 'buzzerstar-21');
//declare the amazon ECS class
$amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'DE', AWS_ASSOCIATE_ID);
//tell the amazon class that we want an array, not an object
$amazonEcs->setReturnType(AmazonECS::RETURN_TYPE_ARRAY);
//create the amazon object (array)
$response = $amazonEcs->category($category)->responseGroup('Small,Images,Offers')->search($search);
//check that there are items in the response
if (isset($response['Items']['Item']) ) {
//loop through each item
foreach ($response['Items']['Item'] as $result) {
//check that there is a ASIN code - for some reason, some items are not
//correctly listed. Im sure there is a reason for it, need to check.
if (isset($result['ASIN'])) {
//store the ASIN code in case we need it
$asin = $result['ASIN'];
//check that there is a URL. If not - no need to bother showing
//this one as we only want linkable items
if (isset($result['DetailPageURL']) && $current_count < $max_ad_results ) {
$current_count++;
$add_text = "";
$detailurl = $result['DetailPageURL'];
$title = $result['ItemAttributes']['Title'];
$image = $result['MediumImage']['URL']; //$result['LargeImage']['URL'];
$hi = $result['MediumImage']['Height'][_]; //$result['MediumImage']['Height'];
$wi = $result['MediumImage']['Width'][_];
$ma = $result['ItemAttributes']['Manufacturer'];
$pg = $result['ItemAttributes']['ProductGroup'];
$lp = $result['OfferSummary']['LowestUsedPrice']['FormattedPrice'];
$lnp = $result['OfferSummary']['LowestNewPrice']['FormattedPrice'];
$pr = $result['Offer']['OfferListing']['IsEligibleForPrime'];
$pr_sav = $result['Offer']['OfferListing']['PercentageSaved'];
if (strlen($lp) <= 1){
$lp = $lnp;
}
if ($pr == 1){
$add_text = "- as
Prime customer you profit from $pr_sav percent
savings!";
}
$title_amp = $this->clear_description($title);
$RelatedMoreContent .=<<
$title_amp
$title ($pg von $ma für $lp $add_text)
END;
/*
//set up a container for the details - this could be a DIV
echo "