Jump to content

Using EAN13 & EAN10 for ISBN numbers


Recommended Posts

If anyone is using Prestashop as an online bookshop & is using the EAN13 number as the ISBN number you'll find some books ISBN numbers are only 10 characters long & include an x at the end "033376157X".
As Prestashop is expecting a 13 'number sequence' It'll not accept this.

To get around it just change line 504 in classes/Validate.php from

return !$ean13 OR preg_match('/^[0-9]{0,13}$/ui', $ean13);



to

return !$ean13 OR preg_match('/^[a-z 0-9]{0,13}$/ui', $ean13);



This is for Prestashop 1.3.7

Link to comment
Share on other sites

  • 8 months later...

Sorry for the necromancy of this thread, but this is apparently still an issue in 1.4.7. I just ran into this today and it failed with a EAN10 with a final digit of "X".

 

On or about Line 581 of the above referenced file, change:

return !$ean13 OR preg_match('/^[0-9]{0,13}$/', $ean13);

to

return !$ean13 OR preg_match('/^[0-9a-zA-Z]{0,13}$/', $ean13);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...