13 digit ISBNs / EAN support / converting to ASINs

conniec - July 29, 2008 - 14:06
Project:Amazon Module
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Will this module eventually work for 13 digit ISBNs since 13 digit ISBNs are becoming the industry standard and 10 digit ISBNs are already being phased out?

Connie

#1

tcblack - September 16, 2008 - 16:21

In my tests I have not been able to get a 13 digit ISBN to work yet, but may be related to http://drupal.org/node/302721

#2

conniec - September 22, 2008 - 03:27

Test the patch from the above node and no luck on my site. 13 Digit ISBNs still won't work

Connie

#3

mleicester - November 4, 2008 - 15:21
Title:13 digit ISBN?s» 13 digit ISBNs / EAN support / converting to ASINs
Status:active» needs review

The Amazon ASIN number is often identical to the same product's ISBN-10 number. However, they are different things. My understanding is that products with 13 digit ISBNs (EANs) also have a 10 character ASIN. For more about the relationship between ISBN-13 numbers and ASINs, read https://affiliate-program.amazon.com/gp/associates/help/t5/a16.

Attached is a patch that implements a lookup for 13 character EANs for the ASIN CCK field. The lookup will validate and convert EANs to ASINs on save (converted during the presave op in hook_field). This lookup uses the Amazon API and therefore has the advantage of being an 'official' conversion from EAN to ASIN. You may also test EAN lookups in the admin test interface. This patch also wraps up the one-line fixes at #302721: Amazon field rejects any product ID. Amazon API test feature works fine though. and #329463: Force fetch when testing ASINs via admin interface.

In most locales, when looking up EANs, you must also specify the search index (e.g. "Books"). This patch adds the ability to configure which search index is used for EAN lookups on the module settings page. Possibly this should be configurable per instance of the ASIN CCK field.

Note: this patch applies against DRUPAL-6--1 but there's no release for 6.x-1.x-dev. It won't apply to 6.x-1.0-beta3.

AttachmentSize
amazon_ean_support.txt 9.45 KB

#4

mleicester - November 5, 2008 - 10:07
Version:6.x-1.0-beta3» 6.x-1.x-dev

#5

conniec - December 17, 2008 - 15:19

Love this patch! Works great for me.

Found a small error. Amazon.module has an extra } at the end of the replacement code.

Hand-applied to alpha5, BTW

Connie

#6

kevcol - January 30, 2009 - 02:02

Your patch worked like a charm for me. (The first patch I've ever installed, btw.) Thanks much!

#7

tirsales - March 2, 2009 - 15:13

Works for me, thanks :)
It would be perfect to allow the inclusion of "-" in the ISBN (e.g. 978-3150106822 instead of 9783150106822) as this is nearer the "default" format, but that is a matter of minor importance.

#8

tirsales - March 2, 2009 - 16:15

Attached is an integration with the patch from #338097: CCK amazon field says that Amazon ID 1591840562 cannot be found but it is retrieved and put in the database as this is more likely to preserve ASINs formatted like numbers.

AttachmentSize
amazon.patch 9.55 KB

#9

rfay - October 4, 2009 - 16:12
Status:needs review» needs work

Thanks for your work on this, and for being willing to contribute.

I'm concerned about the extent and complexity of this patch and would like to discuss it further. I also hate to trigger the child requests to Amazon.com that are a significant performance hit.

Note that Amazon Store has the categories already managed for all locales... Perhaps that should move into Amazon.

Interested in the discussion, here or on IRC. I'm often on.

#10

tirsales - October 12, 2009 - 14:23

Appologies for the delay - I was away for two weeks and in contradiction to my plans had no internet-access available... I will look at the patch again tomorrow and report back ;)

#11

superxain - October 23, 2009 - 09:28

I hope the ASIN field would accept data format like "0-672-32884-4 " (just remove all dashes and spaces automatically ). A quick dirty hack to do the job also will be welcome.

#12

svogel - November 16, 2009 - 12:57

I just managed to put in the changes into the beta-10 and it works again with 13-digit ISBNs. But according to lots of changes in beta-10 it wasn't as easy as supposed to.

I would strongly suggest to put this patch into the destribution as it improves the amazon-module a lot.

Best regards
Stefan

#13

rfay - November 16, 2009 - 14:09

@svogel, do you have a patch to contribute?

#14

conniec - December 8, 2009 - 21:30

hi all,
I haven't done anything in Drupal for a while and am updating some sites.

Has anyone figured out how to convert 13 digit ISBNs into 10 digit ones? Does the Amazon Store module to that for us?

Stefan, which patch did you use?

Connie

#15

rfay - December 8, 2009 - 21:37

Amazon's API is about ASINs, so this module is also focused around ASINs. Amazon started out as a book company, and they based their identifiers around ISBNs, which were 10 digit. Well, they're stuck there.

You can read about this issue at this link. It looks to me like it would be complicated and beyond the scope of this module to do 13-digit ISBNs.

#16

conniec - December 9, 2009 - 12:26

Thanks, Ray, for the quick reply.

I don't know how to make patches but I have a php program that will converet 13 digit ISBNS to 10 digit ISBNs if that will help anyone. But that means changing the ISBNs one by one.

Connie

#17

rfay - December 9, 2009 - 14:15

@conniec, I don't know everything about 13-digit ISBNs, but did you read the Amazon link about 13-digit ISBNs carefully? Your code must not just convert into a 10-digit ISBN, it must convert to the correct Amazon ASIN. If you have confidence you can do that, then I'm interested.

The patch in #8 does try to do this, and the ideas there, if they work, might end up working.

 
 

Drupal is a registered trademark of Dries Buytaert.