You are here:  » Amazon API

Active Forum Topics


Amazon API

Submitted by MarcoCH on Thu, 2019-09-19 16:20 in

Hi

We still support the API of Amazone?
I can not run it on my test page, is there a recent download?

https://www.pricetapestry.com/node/6197

regards
marco

Submitted by support on Fri, 2019-09-20 09:15

Hi marco,

That is the latest version - what happens when you try to run it on your test page? Have you made sure error reporting is enabled - you can put the following in your config.php if you're not sure...

  ini_set('display_errors','on');
  error_reporting(E_ALL);

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Fri, 2019-09-20 09:53

Hi

There is no error message.
I already had an old installation, it does not work there anymore.

Do you have references where the API is running?

regards

Submitted by MarcoCH on Fri, 2019-09-20 10:54

What is the host of Amazon Germany? Still "webservices.amazon.de", find no information.

Submitted by support on Fri, 2019-09-20 11:02

Hi Marco,

That is the correct host - could you try the debug modification in this comment - that will let you view the raw API response which may indicate the problem with an error message from the server. If you're not seeing any response that would indicate that the request is not even being made, in either case if you're still not sure let me know and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Fri, 2019-09-20 12:03

Hi

The direct link works: {link saved}

The search works: {link saved}

I think I destroyed something when I am with the article, then always turns the wheel: {link saved}

regards
Marco

Submitted by support on Fri, 2019-09-20 12:24

Hi Marco,

There's a problem with prices_amazon.php - try the direct link to searchresults_amazon.php that works and change to prices_amazon.php - blank screen which indicates that an error is occurring (but server configured not to reveal error message).

However an accidental modification could cause a syntax error in which case adding ini_set('display_errors','on'); to the script wouldn't help... Try uploading the file from the distribution again and see if that does the trick, if still no joy let me know and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Fri, 2019-09-20 14:08

Hi

I found the error, there was a typo in my adjustment in the file prices_amazon.php

Thanks for your help!

Best regards

Submitted by MarcoCH on Fri, 2019-09-20 14:11

Hi

Can I replace: "Sorry, no results found"

also insert a code from Amazon?

regards
Marco

Submitted by support on Mon, 2019-09-23 08:19

Hi Marco,

Sure - you can replace the no results text with a generic Amazon affiliate banner or other code. It's in searchresults_amazon.php (line 135) and prices_amazon.php (line 165)...

      print "<p>".translate("Sorry, no results found")."</p>";

...so to come out of PHP mode at this point to add your banner code, replace with:

      ?>
      ...no results banner or link HTML here...
      <?php

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Tue, 2019-09-24 18:20

Hi

I want to have the Amazon Tab active, I could do that.
How do I do that the Amazon products are loaded directly without "onclick".

regards
Marco

Submitted by support on Wed, 2019-09-25 10:01

Hi Marco,

The Async API version of html/searchresults.php should be doing that - if there are no database search results only the Amazon / eBay tabs are displayed and the Amazon tab is active by default - can you check for this code in the version you are using:

<?php
  
if (file_exists("html/ebay.php"))
  {
    
$searchresults_use_ebay TRUE;
    
$searchresults_active ="ebay";
  }
  if (
file_exists("html/amazon.php"))
  {
    
$searchresults_use_amazon TRUE;
    
$searchresults_active ="amazon";
  }
  if (isset(
$searchresults))
  {
    
$searchresults_use_searchresults TRUE;
    
$searchresults_active ="searchresults";
  }
?>

Notice how the sections are in reverse order, setting $searchresults_active each time, the final case only setting the value to "searchresults" if there are search results to display.

Is the version you are running showing all 3 tabs even if no database results?

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Tue, 2019-10-01 18:22

Hi

Is this code correct?

      ?>
      ...no results banner or link HTML here...
      <?php

For me, the original code looks like this (line 162-168)

    }
    else
    {
      print "<p>".translate("Sorry, no results found")."</p>";
    }
  }
?>

Greets
Marco

Submitted by support on Wed, 2019-10-02 10:30

Hi Marco,

That is consistent with prices_amazon.php - the replacement is just line 165, so the replacement of the section you posted above would be:

    }
    else
    {
      ?>
      ...no results banner or link HTML here...
      <?php
    }
  }
?>

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Wed, 2019-10-02 12:26

it does not work

if I have a text then it works, but I have a banner script that appears at the bottom, below the footer.

greets
marco

Submitted by support on Wed, 2019-10-02 13:01

Hi Marco,

Try enclosing the banner code within a <p> element like the text, for example:

      ?>
        <p>
          ...no results banner or link HTML here...
        </p>
      <?php

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by MarcoCH on Wed, 2019-10-02 13:12

Unfortunately, no,
the banner still appears at the bottom

should i send a print screen?

greets
marco

Submitted by support on Wed, 2019-10-02 14:05

Hi Marco,

Sure - drop me an email with the screenshot, and also the modified prices_amazon.php and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com