When using the store to dsplay item details for products like ASIN=B004DWUSG2 "Masonic Gateway Symbol 8 mm Comfort Fit Mens Black Tungsten Wedding Band Ring Sizes 8 to 13", the select box for "Ring Size" is empty.
Even if I hand-construct a page with store links for each ring size, the "Similar Items" block has links to other products which display the same problem.
I do not want to use direct links into the Amazon.com site, but it would seem that this is my only option until this issue is addressed.
The "Buying Options" block appears to be constructed through ctools_plugins/content_types/item_offers.inc, but I am not familiar enough with the API to investigate further.
Comments
Comment #1
Triskelion commentedUpdate: I have confirmed that the problem with "Ring Size" selection exists in the 6.2 branch as well, and that there appears to be no problem with other Buying Options, eg ASIN=B000H19F0I "Allen Edmonds Men's Cody Tassel Loafer". For some reason shoes work properly, but jewelry does not.
If this is a problem from Amazon or with how the module filters information from Amazon is not clear.
Comment #2
rfayThis product is not offered for sale by Amazon: http://www.amazon.com/Masonic-Gateway-Comfort-Tungsten-Wedding/dp/B004DW..., and the Amazon API doesn't support things not sold by them any more.
At least I'm betting that's the issue.
Comment #3
Triskelion commentedI have looked further. The xml data provided by Amazon is cached in cache_amazon_store, and a simple 'select data into outfile...' allowed me to inspect it. I have attached two files (as .txt but these are xml files), one for rings and one for footwear. You can see that Amazon provides full information on the Ringsize attribute and the information appears to be well formed, just like the footwear. Looking at another item, ASIN=B004TG0VLO, also not offered for sale by Amazon, Color and Size buying options work correctly.
The other difference between the two is that the ring only has a single option (dimension) whereas the footwear and clothing both have two. I have looked at _amazon_store_process_variations() and I would guess that the root dimension is being reset somehow as the non-existant tree is being iterated.
I will continue to look into this, but someone more familiar with the module could probably find the problem before I do.
Comment #4
Triskelion commentedFound it. It would seem that Amazon may not list the VariationAttributes under the Variation->ItemAttributes. Probably some weird boundary condition in their code. The information is however always available under Item->Variation->Item->VariationAttributes as Name,Value pairs. Adding the following code after line 925 of the module fixed the problem:
I would guess that using this logic and ignoring ItemAttributes would probably better suit the general case, but I leave that in your hands.
Comment #5
rfayNice work - a patch would be appreciated.
Comment #6
Triskelion commentedAs I suspected, the logic appears to work well in the general case, so I replaced line 925.
The patch file is a unified diff against the current 7.x-dev module. I have taken the liberty of changing the status to 'needs review'.
Hope this helps and qualifies for a commit.
Comment #7
rfayNo liberty involved - the right thing to do. Thanks!
Comment #8
willvincent commentedImproper format and naming convention for the patch.. but the code change is confirmed working.
Here's a proper re-roll, and this change has been commit.
Comment #9
willvincent commentedComment #10
likewhoa commentedThis patch is no longer working with latest -dev. I have tried with 2 different amazon items 'shoe and ring' and both items don't show buying options. I also don't see any indication of variations in the returned array so perhaps something changed.