Jump to content
Sign in to follow this  
greasemonkey

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....

Share this post


Link to post
Share on other sites

GTIN must be saved padded to 14 digits. Had this conversation recently with “fridgebox” check back through his posts...


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites

 


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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 

Share this post


Link to post
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. 


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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
Sign in to follow this  

×