Page 1 of 1

Product UPC database field too short

Posted: Thu Jun 14, 2012 7:53 pm
by TheMasterBrewer
The database field size for the UPC code in the product table is too small. We have been experiencing issues with our Google Shopping feed for some time as it keeps rejecting our UPC codes for being invalid. We have now realised that OpenCart is actually removing the last 1-2 characters of most of our products' UPC codes due to the database field size being too small, hence making them invalid. (I'm guessing that the limit is what it is because UPC codes in the US are shorter than they are in the UK?)

I would therefore suggest that the UPC field size is increased by at least 3 characters - could make a big difference to a lot of folks outside the US!

Re: Product UPC database field too short

Posted: Thu Jun 14, 2012 11:38 pm
by rph
Are you sure you're not putting in non-numeric characters? Google expects a UPC to be 12 digits which is what the OpenCart database is set to.

Re: Product UPC database field too short

Posted: Thu Jun 14, 2012 11:41 pm
by TheMasterBrewer
Yep, 100% certain!

Re: Product UPC database field too short

Posted: Thu Jun 14, 2012 11:46 pm
by Daniel
so what does it need to be?

Re: Product UPC database field too short

Posted: Thu Jun 14, 2012 11:51 pm
by TheMasterBrewer
I'm pretty confused by the different formats etc but I'd suggest 15 to be on the safe side

Re: Product UPC database field too short

Posted: Fri Jun 15, 2012 3:21 am
by rph
TheMasterBrewer wrote:Yep, 100% certain!
Did you check if it's an EAN code?

Re: Product UPC database field too short

Posted: Fri Jun 15, 2012 4:29 am
by TheMasterBrewer
rph wrote:Did you check if it's an EAN code?
That's where I'm a little confused by all the different formats - there seem to be at least 3-4 different ones. But the one we're using is the number alongside the barcode on each of our products, which is sometimes 12 numbers but sometimes more. Is the barcode number always the same format or can it vary?

Re: Product UPC database field too short

Posted: Fri Jun 15, 2012 12:14 pm
by rph
There are multiple formats but a UPC should always be 12 digits to my knowledge. UPCs are primarily used in North America and a few other English speaking countries, EAN (13 or 14 digit) is used in Europe, and JAN (8 or 13 digit) is used in Japan.

http://support.google.com/merchants/bin ... wer=160161

Re: Product UPC database field too short

Posted: Fri Jun 15, 2012 6:09 pm
by TheMasterBrewer
It seems like the more I learn about this, the more it confuses me! So in the US it's 12 digits but most other places it could be anything from 8 to 14 digits - or even more! Does that mean that Google allows products with UPCs of 14 digits if you're selling products in certain countries outside the US? What confuses me is that some of our products have UPCs of more than 12 digits (hence they must be manufactured outside the UK) but we're selling them in the UK. So surely Google needs to accept some of our UPCs as 12 digits and others as more than 12 digits? My head hurts...

???

Re: Product UPC database field too short

Posted: Sat Jun 16, 2012 12:39 am
by rph
The problem is UPC has become synonymous with barcode/GTIN when there are several different formats. Google feeds will accept multiple GTIN types (UPC, EAN, JAN, ISBN) but OpenCart only has an entry for UPCs.

http://www.gtin.info/

Re: Product UPC database field too short

Posted: Sat Jun 16, 2012 6:13 pm
by TheMasterBrewer
rph wrote:The problem is UPC has become synonymous with barcode/GTIN when there are several different formats. Google feeds will accept multiple GTIN types (UPC, EAN, JAN, ISBN) but OpenCart only has an entry for UPCs.

http://www.gtin.info/
In that case I think increasing the DB field size will indeed be necessary - some of our product codes were being rejected by Google until we increased the maximum field size in our DB and re-entered them all, so they must have been EAN or something.

Re: Product UPC database field too short

Posted: Sun Jun 17, 2012 3:15 am
by rph
No, UPCs have 12 digits. It's correct as it is. Feeding an EAN or JAN as a UPC through Google base will not work. You need specific entries for those GTIN types.

Re: Product UPC database field too short

Posted: Tue Jun 19, 2012 3:19 pm
by Daniel
what are the sizes for these fields?

UPC, EAN, JAN, ISBN

i will add them all.

Re: Product UPC database field too short

Posted: Wed Jun 20, 2012 1:35 am
by rph

Re: Product UPC database field too short

Posted: Sun Jan 25, 2015 12:14 am
by exit15
While UPC code is technically 12 digits, making the field bigger can solve errors with your merchant feed. I am a store owner in the USA and my suppliers provide us UPC codes that are 12, 13 and 14 digits long (imported products!). All bar-codes will scan in retail because the number is "complete", but chopping off the UPC after the first 12 digits results in feed errors. The reason being that the last digit, the check-sum digit, suddenly shifted and become invalid.

I would make it varchar 64 and be done with it. In the mean time, one can use the SKU filed which 64 chars long to submit to Google as the GTIN

Re: Product UPC database field too short

Posted: Tue Jan 27, 2015 1:28 am
by rph
OpenCart now has additional GTIN types. You should be importing to the correct one rather than dumping them all in UPC.

Re: Product UPC database field too short

Posted: Sat Mar 05, 2016 7:11 am
by unowho
Strange as this sounds, my wholesale supplier provides me with 13 digit UPC numbers, so where in the database can I change the lenght, as I now need to go in and change all my numbers again, as the UPC last digit has dropped in all of them.