Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

GTIN - using two different methods


Recommended Posts

@burt I'm having a issue with the GTIN content module and the changes made to admin/categories.php make this work.

I sell products from both the EU and North America - a combo of UPC and EAN numbers including UPC-A (12 digits) and even some UPC-E (8 digits).

I have the content module set to 13 to allow for the EU 13 digit EAN numbers....

No matter what the GTIN number is - admin/categories.php it add "zero's" to make it the length of 13.

I have double checked by editing the GTIN in the DB - as soon as I open and save the item in admin/categories.php it again makes the GTIN 13 digits.

Could we simplify?

        $sql_data_array['products_gtin'] = (tep_not_null($_POST['products_gtin'])) ? str_pad(tep_db_prepare_input($_POST['products_gtin']), 14, '0', STR_PAD_LEFT) : 'null';

Just add to the array above as (below model number)

'products_gtin' => tep_db_prepare_input($_POST['products_gtin']),

I think it would be best to remove the length of the string all together....

Link to comment
Share on other sites

@burt yes of course Gary.... I completely forgot about that thread. 

Just double checking my catalog feeds: Google & Facebook recognizes this format... and Amazon seems to be able to figure it out when uploading with their formatted xls... so far so good. Only issue so far is the Walmart marketplace needs to specify UPC/EAN and must match the number of digits/characters allowed for each. 

Ultimately, because I had my own addon previous to you adding this to the core, which didn’t consider GTIN, my DB now has a mix of 8 & 12 digit UPC, 13 Digit EAN and now 14 digit GTIN. 
 

Complicating this somewhat is our retail POS... I’ll figure this out for my needs. 
 

thanks 

Link to comment
Share on other sites

It's as fridgebox aka oscmarket aka henry says...it's difficult to determine what type of GTIN to show if the GTIN has been stored correctly...

In that thread is some code I found and linked to.  This code allows you to pass a padded GTIN (ie 00000123456789) and it will correctly determine what type of GTIN to output.  Note that I did not look closely at the code (only quickly tested it).

That code plugged into a new GTIN module would, I think, near enough suit your needs. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...