(The Amazon module issue is at #905198: Customer reviews no longer in Amazon API after 8 Nov 2010
Dear Product Advertising API Developer,
On November 8, 2010 the Reviews response group of the Product Advertising API will no longer return customer reviews content and instead will return a link to customer reviews content hosted on Amazon.com. You will be able to display customer reviews on your site using that link. Please refer to the Product Advertising API Developer guide found here for more details. The Reviews response group will continue to function as before until November 8 and the new link to customer reviews is available to you now through the Product Advertising API as well.
Thank you for advertising products for sale on Amazon.com.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | amazon_store.remove_customer_reviews.patch | 1.6 KB | rfay |
| #15 | amazon_store.customer_reviews_iframe_905200_15.patch | 2.01 KB | rfay |
| #6 | amazon_store.customer_reviews_iframe_905200_06.patch | 2.01 KB | rfay |
| #3 | add_iframe_url.patch | 2.43 KB | the_g_bomb |
Comments
Comment #1
the_g_bomb commentedI will look into the Amazon module as well, but I think until we can work around that fact that the only review data that will be sent by Amazon is an iframe url, as a temporary work around to stop the feature disappearing on the 8th Nov we could add:
to the amazon_store_item_reviews_panel.tpl.php
I will try to create a patch to this effect once I have looked into the Amazon module requirements
Comment #2
the_g_bomb commentedFor any one else interested details of the Product Advertising API Developer Guide can be found at:
http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/
And more general information about the various releases of that document:
http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryI...
The specific information regarding this issue can be found in the PA API DG under Programming guide > Motivating Customers to Buy about a third of the way down the page is Getting Customer Reviews.:
http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/CHAP_Mot...
or on the page about Reviews Response Group which shows the current return:
http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/RG_Revie...
Comment #3
the_g_bomb commentedFirst patch attempt.
It will display the iframe url, if the iframeURL is provided, but the actual data ($item->CustomerReviews->Review) is not.
This should stand as a backup for when the change over occurs, at least this way something will be displayed in the worst case scenario. Hopefully, I can create a patch for the Amazon module before this is needed. I propose to scrape the iframeURL page and populate the database with the same data that is currently populating it. That way when this file gets called the data will be there and this patch will become irrelevant.
Comment #4
rfayI prefer to do 7.x first on these, so we can remember what's been done, but I'll see if I can give this a look this week. Thanks for the effort here!
-Randy
Comment #5
rfayPlease don't use the single-line conditional; always use braces.
Powered by Dreditor.
Comment #6
rfay@the_g_bomb, so sorry I took so long to review this. I was teaching a couple of those weeks, recovering the weeks in between, and.... well I very much appreciate your contribution here and hope you'll continue.
Here's my take on it. The way I read it they are going to rip out *everything* but the URL, so we should just take all the other stuff out.
Unfortunately the result is quite ugly, so I removed it from the default item display. If you can figure out how to make it look better, I don't mind it being there. People can still use panels to place it if they want it.
Looking forward to your review.
-Randy
Comment #7
the_g_bomb commentedI took a couple of looks over the patch file and it looks good.
Patch applied and installed fine, module working as expected, minus the customer reviews obviously.
I did wonder if we might want to add a checkbox into the admin settings offering the user the choice of whether to display the iframe or not.
Something like this might do:
and also:
What would your thoughts be on this?
Comment #8
rfayI'm open to it. A simpler approach is just to put commented-out code in the .tpl.php file.
Can you make some code that even makes it look halfway decent? I had it in there and ripped it out because it was just awful. There's no good way to know how big it ought to be, and then you get scrollbars, etc. My expectation is that this will no longer be useful to Amazon API customers.
Comment #9
the_g_bomb commentedYeah, fair point, it did look like it was kind of crammed into a tiny box and I don't think my ideal solution would be to have the iframe their either.
I did originally have a quick look to see where the iframe size was set but couldn't find the responsible code. I'll have another play with it too see what I can come up with.
The other alternative is to scrape the iframe and save the data back to the database and display the reviews as before, but this may outwith the scope of this module. Perhaps we should hang off doing anything else to see what kind of responses there are if there are any requests to put the customer reviews back in.
Comment #10
rfayStoring Amazon data longer than 24 hours (I think it is) also violates the license agreement. But you're right; we don't even have to scrape the data; we could just drupal_http_request() it, and we'd have it. So that is probably a better solution if we're going to do anything. However, then we have absolutely no control over the formatting or anything.
Comment #11
the_g_bomb commentedI have been looking at setting height and width on the iframe. Setting the width to 100% seems to work ok, then I started trying to see if it would be possible to use: $amazon_item->CustomerReviews->TotalReviews to work out a potential height that the iframe may need to be. The URL seems to display 3 reviews with a link to more if they exist.
From what I can see, using the Garland theme (not sure yet if that makes a difference) we have:
150px top (logo and averages)
approx 300-400px per review
55px bottom (create your own link and see all reviews)
based on this we could:
its possible to throw a scrolling = no in there as well if you want,
but this is a kinda messy solution and I'm still not convinced its worth spending alot of time ironing out all the kinks in it, such as page resizing, font resizing etc.
It could also be possible to use jQuery to grab the height of the IFrameURL page then set the iframe height with that, probably a tidier solution.
Comment #12
rfayDon't forget that *everything* in CustomerReviews except IFrameURL is going away! At least that's the way I read the docs.
Comment #13
the_g_bomb commentedYour absolutely right on that. Only the IFrameURL will be returned in future.
Comment #14
the_g_bomb commentedAnd on top of that jQuery is out too.
Javascript will not work on iFrames accessing content from a different domain since the window object i.e. the IFrameURL cannot be accessed from the item page due to JavaScript security restrictions.
So, I think you are correct to just remove this as formatting this will probably just end up looking awful. What a shame.
Comment #15
rfayOK, here's a reroll against DRUPAL-6--2. I'll commit this one.
Comment #16
rfayCommitted to DRUPAL-6--2: http://drupal.org/cvs?commit=444814
Now we have to do D7.
Please test the dev version and make sure everything is OK.
Comment #17
rfayHere's the D7 version
Comment #18
rfayAnd committed: http://drupal.org/cvs?commit=458088