View Single Post
  #2 (permalink)  
Old 07-31-2008, 02:10 AM
atrus123 atrus123 is offline
Junior Member
 
Join Date: Jul 2008
Posts: 8
Default

This does help, but I'm still having a problem with this service. Specifically, my foreach loop produces ten results, but I can't seem to get anything to actually show up. I.e., my tags are all empty.

Here's what I've got so far:

Code:
class Amazon
{
    function getAmazon($keywords)
    {
        $amazon = new Zend_Service_Amazon_Query('APIKEYGOESHERE','US');
        $amazon->category('Books')
            ->Keywords($keywords)
            ->ResponseGroup('Small,Images');
        $results = $amazon->search();
        if ($results->totalResults() > 0)
        {
            return $results;
        }
        else
        {
            return NULL;
        }
    }
}
Code:
$amazon = new Amazon;
$aresults = $amazon->getAmazon($tag1);
$this->view->amazon = $aresults;
Code:
<?php foreach($this->amazon as $key => $amazon) : ?>
<div><a href = "<?php $amazon->DetailPageURL; ?>"><img src = "<?php $amazon->SmallImage->Url; ?>" /></a></div>
<?php endforeach; ?>
Any guidance would be appreciated.

Edit: I'm an idiot. I just forgot the friggin' echo. I must have stared at this for an hour without seeing that.

Last edited by atrus123 : 08-03-2008 at 12:11 AM. Reason: I'm an idiot...
Reply With Quote