Hi,
I am having a problem in the cart page, when I add an item I have this error message:
Notice : Undefined offset: 0 dans template_preprocess_amazon_store_cart() (ligne 181 dans /homez.162/xxxxx/sites/all/modules/amazon_store/amazon_store.pages.inc).
Any ideas?
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | amazon_store.merchantid_now_means_something_different.patch | 6.07 KB | rfay |
| #5 | Removed_MerchantID_support-1257714-5.patch | 81.71 KB | the_g_bomb |
Comments
Comment #1
rfayI can confirm this when adding an item to the cart and then hitting the "view cart" link
Here's the code in question. What's happening is that Amazon has dropped support for merchants almost everywhere in the API. See #1230606: October 25, 2011 Amazon API changes (Must be done by then). So we need to go rip out the merchant ID stuff.
Comment #2
cloporto commentedSo what can we do to fix it?
Comment #3
rfay1. You can turn off warnings to the screen.
2. Code changes will be required here.
3. You could use the previous stable version of Amazon module and I think it would avoid this until October 25.
Comment #4
rfayMarked #1253812: When used with Amazon Store module, "merchant" in Buying Option displays only one merchant as a duplicate.
Comment #5
the_g_bomb commentedIs this the kind of thing you are looking for?
Also let me know if this patch is ok, I had to work quite a bit to get the diff to create a non-zero file and when I did get one produced, this looked slightly different to how I expected, but all the relevant info seems to be there.
Comment #6
rfayThanks so much for tackling this, @the_g_bomb!
I hate how intrusive this change is - Amazon really threw us a loop here.
Yes, this is the idea (I think). I assume you're gone and dug through the new WSDL to make sure this makes sense. But I'm pretty sure this is on track.
There is one very important thing that goes along with it. I think if you look at the WSDL and the documentation you'll find that #1259176: Views: "Amazon Price (numeric)" and "Amazon Price (Formatted)" do not display correctly is also this issue. So I guess we'll have to remove a couple of price fields, add a new one, *and* change the database and write a hook_update_N(). Painful.
Marking #1259176: Views: "Amazon Price (numeric)" and "Amazon Price (Formatted)" do not display correctly as a duplicate of this one.
Comment #7
rfayOh, I was all messed up, confused between Amazon Store and Amazon. Sorry. Unmarking that as dup. Wouldn't mind if you took it on! I do think you're on the right track here.
Comment #8
rfay@the_g_bomb I was just doing a bit of work and noticed that with at least one ASIN, 1605500445, Amazon is still providing a non-Amazon merchant. So it's possible we need to read the changes more carefully.
It's also possible that we should try to do this work immediately after the October 25 deadline, although I would think that just switching the AMAZON_ECS_SCHEMA to 2011-08-01 (as we've already done if the latest Amazon is there) would put us in the post-October 25 scenario.
Anyway, I appreciate your work on this, and hope you have a little time to completely come to grips with what they're doing so we don't make a mistake.
Comment #9
the_g_bomb commentedOf course I'll look into it further, I must admit on first reading, I took it that Merchant support was being dropped, but you may be right that it is just searching on MerchantID is being dropped. I'll have a re-read and try to completely come to grips with it as you say.
Last thing I want is to remove support that doesn't need to be removed. I try to get back to it shortly.
Comment #10
the_g_bomb commentedI got the below message this morning from Amazon:
Might be worthwhile organising a remote sprint for the duration to examine what changes take place.
I'm not sure if this is just for the UK locale, but I would be happy to schedule something for a US timeslot if one is happening at a different time.
Dear Product Advertising API Developer,
We wanted to remind you of the upcoming changes to the Product Advertising API, which will take effect on October 26, 2011.
To help our customers prepare for the upcoming changes, on October 18, 2011, the changes to the API will go live for 4 hours (from 6 PM to 10 PM GMT) so that you can experience how the API will behave after these changes take effect. For more details about the API changes, please visit the Product Advertising API homepage.
Thank you for using the Product Advertising API to advertise Amazon.
Sincerely,
The Product Advertising API Team
Comment #11
rfayGood idea. I was just about to say we would just have to wait until they actually change it to find out what they really mean.
Unfortunately, I'll be on a plane for that exact 4 hours according to current plans (returning from PNWDS). But would appreciate you checking in with them.
The more I read the spec, the more I think they're completely removing the merchant ID and going with Amazon only. Which would mean selling only items that Amazon offers. It should be fairly easy to sort that out on Oct 18. We can probably mostly sort this out by trying a couple of non-Amazon high-profile ASINs from the amazon.com site on that day.
@the_g_bomb++
And it looks like your full project application is getting really close!
Comment #12
rfayNow that we actually have the real Amazon data to work with, it's a little easier.
This patch tries to address what Amazon actually did:
* They return just one offer per item
* If you say "MerchantId == Amazon", they return *only* Amazon's offer
* If you *don't* put MerchantId == Amazon, they return one offer that is *not* from Amazon. Odd.
Would appreciate review.
Also marking #1289526: Notice: Undefined offset: 0 in template_preprocess_amazon_store_cart() as a duplicate of this one.
This will also need to be ported to D6.
Comment #13
the_g_bomb commentedPatch applies cleanly, but I'm getting errors, now, when I view default page at: amazon_store.
Interestingly the errors don't appear if I do a search.
I will double check that my modules don't have legacy code changes in there, as reverting the patch also means I can't replicate the original error either.
Comment #14
rfayI guess this needs another round then. Wish I'd gotten it in before the 7.x-1.0 release. I forgot about it.
Comment #15
rfayThe problem reported in #13 already existed before this patch, as reported in #1167278: Error being received in the Store on ASIN 0739479199 with panels
Comment #16
rfayThere's a patch now over there, so would appreciate testing on this one. The problem there was due to the API change, but not due to this patch.
Comment #17
the_g_bomb commentedJust getting round to re-test. Patch applies cleanly and the errors are not appearing with the other patch applied as requested.
I think I'll need to look into this a bit more before I can confirm it is doing what is says as neither setting (Amazon or All) seems to have any effect with my locale set to the UK. Both are only showing Amazon only products.
Comment #18
rfay@the_g_bomb IMO if you think this is OK, please go ahead and commit. No commits have been made since 7.x-1.0, so it seems like this would be a fine time.
Comment #19
the_g_bomb commentedCommitted #12 - 4d04ca4
Comment #20
chien_fu commentedThis sounds good. I'm glad this worked. Is it being ported to D7 as well?
Thanks!
Comment #21
rfayIt's in the "patch to be ported" state, meaning that it's waiting for somebody to port it to D6.
Comment #22
avpadernoI am closing this issue, as it's for a release that is now not supported.