Most retailers use a GTIN (Global Trade Item Number) to track and identify their products, but WooCommerce does not have this field by default.

In this post I’ll show you how to add it.

What is a GTIN?

A GTIN is a unique, internationally recognized product tracking number.

In North America, a UPC code is used, while in Europe it’s called an EAN. You may also have heard of an ISBN, which is used for books.

GTINs are used for internal tracking, and are required in product feeds for Google and Amazon.

How to add a UPC/EAN/ISBN field to WooCommerce

WooCommerce UPC field

By default, WooCommerce comes with a field for SKU, but not GTIN. To add the GTIN field for your UPC, EAN, or ISBN number, we can either use a plugin or custom code.

Here are some things to consider about your GTIN:

  • GTIN field is optional, and can be shown or hidden on product pages.
  • Variable products must allow for separate GTINs for each variation
  • GTIN can be used for Google and Amazon product feeds

Doing this with custom code is a bit complicated, so I built a plugin to do this all for you.

It’s called WooCommerce Add GTIN and you can get it by going to plugins => add new, or download it directly.

This plugin adds a GTIN field to each product under Inventory. It also adds a unique GTIN field for each product variation.

The GTIN is displayed on the product page with the other product meta. To hide the GTIN on the product page, visit WooCommerce settings => Products => Inventory => “Hide GTIN on single product pages.”

If you have feedback or feature requests for this plugin please let me know in the comments.

Published by Scott

18 Comments

  1. Hi Scott,

    THanks for the plugin, it works great.
    What is the name of the variable to get the GTIN for each item ?
    This is for google merchandising for instance.

    Thanks

    Anton

    Reply
    • Hi, the main GTIN is in post meta under hwp_product_gtin:

      get_post_meta( $post_id, 'hwp_product_gtin', 1 );

      If you have variations with GTINs, you can find those in post meta like this:

      get_post_meta( $variation['variation_id'], 'hwp_var_gtin', 1 );

      You have to loop through the variations to get that.

      Reply
  2. Hello.
    Will this field be searchable in woocommerce backend ? I mean in example on the orders list page or products list page or either when adding a product to a new order (backend) this would be great to use the backend as a casher with a barcode reader.

    Reply
    • Hi, this plugin uses post meta, I don’t know if that’s searchable. You may have to use a plugin that incorporates post meta into search, but it should be possible.

      Reply
  3. Hi Scott,

    This looks like a great plugin! Thank you for making it available!

    A question please, if I may?

    I’m trying to setup a Google shopping feed and Google is requiring Brand and GTIN. I am using a plugin that I downloaded to build this feed. It’s allowing me to map my fields to the required shopping feed by having me choose from a drop down list. Will the GTIN from your plugin show in the dropdown list?

    Thanks!!

    Reply
    • Hi Mark, the plugin uses the following post meta keys:

      hwp_product_gtin, and hwp_var_gtin.

      I’m not sure how your feed plugin works, but you would have to map it to those values as needed.

      Reply
  4. Thanks for the great plugin. We are currently trying to access the GTIN field through WooCommerce REST API, but can’t find the field anywhere?

    Any clues where to look?

    Reply
  5. Hi.

    I have added the plugin.
    the field is shown as described
    but it is empty.
    do I need to enter a Gtin to each product?

    thank you.

    Reply
  6. Hi scott

    Thanks for this great plug in, its added exactly what i needed to my woocommerce store. Only problem i have is that we have installed a POS plug in for the shop as a physical shop is opening in a few weeks. The plug in im using is woocommerce POS by actualityextensions. The plug in allows you to use a scanner to scan EAN products, only problem is in the POS plug in you need to select which fields to search when scanned. Iv looked for hwp_product_gtin, and hwp_var_gtin, but neither show up in the list of searchable fields. Any way i can make the EANs searchable.

    Thanks

    Reply
  7. Can I move the field under SKU field on product variations ?

    Reply
  8. Hej Scott,

    can I change GTIN field to become a Brand field? 🙂
    Maybe by modifying your plugin?

    Reply
  9. Hi Scott

    Great plugin and it worked perfectly on my single store, but when i try it in multistore the “field” wont show. You experienced any thing like it?

    Best Regards Lasse

    Reply
  10. As you can see from the first screen shot below I installed “WooCommerce UPC, EAN, and ISBN” at https://pigglywigglyorder.com but the second screen shot shows that the option is not available under the Inventory Tab. Please advise.

    i.is.cc/rS1Dv8N.png

    i.is.cc/rSciYoc.png

    Reply
  11. I’m using the ‘WooCommerce Customer/Order CSV Export’ plugin, which allows me to assing and add a meta field to my exported CSV reports.

    I’ve assumed the field I need to add to my export report is ‘hwp_product_gtin’, so I’ve added this field, however nothing is showing up in my exported report.

    Is anyone able to share any code – or guidance – to assist me in achieving this (I’m assuming something needs to be set up in funtions.php to register the field) ?

    I’m out of my depth with this sort of thing so I’d be most grateful for any assistance.

    Cheers, Joel

    Reply
  12. Can you tell us the steps for imports products with CSV with the GTIN, I can’t do it with the information of hwp_product_gtin.

    Thanks!

    Reply
  13. hi,
    i recently install the plugin but i need to export this field in the csv file.

    i’m tryind to do it with products->export, but the generated file does not contain the gtin field.
    how can i do it?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Get 50% off the Pro Bundle! Use code holler50 on checkout.

Holler Box

Content Upgrade Bonuses

Get 3 free bonuses to make it easier for you to create better content upgrades:
  • 21 extra content upgrade ideas and examples
  • Free canva.com ebook cover design
  • Free 3D ebook cover Photoshop action
Enter your name and email below.
Holler Box

WooCommerce Statistics Infographic

Enter your email below to get our analysis of 2017 WooCommerce statistics in a handy PDF infographic.
Holler Box
Tweet
Share