Settings
Once installed and activated you can access the plugin’s settings from “WooCommerce > Settings > EAN”.
Here is a list of all the sections under the settings, we will look at each option one by one.
EAN Options
Barcode Options
Print Options
Advanced Options
Shortcodes
There are three shortcodes available in the plugin:
[alg_wc_ean]
[alg_wc_ean_barcode]
[alg_wc_ean_barcode_2d]
[alg_wc_ean]
[alg_wc_ean]
shortcode outputs product’s EAN.
Attributes
- product_id
- (Optional) Product ID. If empty, will automatically retrieve the current product ID.
- before
- (Optional) Content to output before the EAN. E.g.
EAN:
. Default is empty. - after
- (Optional) Content to output after the EAN. Default is empty.
[alg_wc_ean_barcode]
and [alg_wc_ean_barcode_2d]
[alg_wc_ean_barcode]
and [alg_wc_ean_barcode_2d]
shortcodes output product’s 1D and 2D barcodes respectively.
Attributes
- product_id
- (Optional) Product ID. If empty, will automatically retrieve the current product ID.
- before
- (Optional) Content to output before the barcode. Default is empty.
- after
- (Optional) Content to output after the barcode. Default is empty.
- children
- (Optional) If set to
yes
, will output variations’ barcodes for a variable product. Default isno
. - glue
- (Optional) Used to “glue” the variations’ barcodes for a variable product. Used only if the
children
attribute is set toyes
. Default is empty. - w
- (Optional) Barcode width. Default is
2
. - h
- (Optional) Barcode height. Default is
30
for 1D barcodes, and2
for 2D barcodes. - template
- (Optional) Template. Default is
%barcode_img%
. Available placeholders:%barcode_img%
,%product_id%
,%product_title%
,%value%
. - content
- (Optional) Sets what have to be encoded in the barcode. Default is
ean
. Available values are:- ean
- Encode product EAN. You can override the product EAN with the
ean
attribute. - sku
- Encode product SKU.
- url
- Encode product URL.
- admin_url
- Encode product admin URL. Please note that it will encode parent (i.e. variable) product URL for the variations.
- admin_search
- Encode product admin search URL.
- increase_stock
- Encode product increase stock action. You can set quantity with the
stock_qty
attribute (default is1
).max_stock
attribute allows you to set limit for the action, i.e. action can’t increase the stock above themax_stock
. - decrease_stock
- Encode product decrease stock action. You can set quantity with the
stock_qty
attribute (default is1
).min_stock
attribute allows you to set limit for the action, i.e. action can’t reduce the stock below themin_stock
. - add_to_cart
- Encode product add to cart action. You can set quantity with the
qty
attribute (default is1
). You can set user with theuser_id
attribute (default is1
). - add_to_cart_url
- Encode product add to cart URL. Please note that there is no add to cart URL for a variable product, however, you can encode the add to cart URL for the variations.
- ean
- (Optional) Overrides product’s EAN. Used only if the
content
attribute is set toean
. Default is empty. - stock_qty
- (Optional) Used only if the
content
attribute is set todecrease_stock
orincrease_stock
. Default is1
. - min_stock
- (Optional) Used only if the
content
attribute is set todecrease_stock
. Default is empty. - max_stock
- (Optional) Used only if the
content
attribute is set toincrease_stock
. Default is empty. - qty
- (Optional) Used only if the
content
attribute is set toadd_to_cart
. Default is1
. - user_id
- (Optional) Used only if the
content
attribute is set toadd_to_cart
. Default is1
.
Examples
This will output the 2D barcode for the current product:
[alg_wc_ean_barcode_2d]
This will output the 2D barcode for the selected product:
[alg_wc_ean_barcode_2d product_id="123"]
This will output the 2D barcode for the predefined EAN:
[alg_wc_ean_barcode_2d ean="5901234123457"]
This will encode and output current product URL in 2D barcode:
[alg_wc_ean_barcode_2d content="url"]
Tools
Tools are located in “WooCommerce > Settings > EAN > Tools”. Check the box and “Save changes” to run the tool. Please note that there is no undo for these tools.
Product Tools
Please note that Generate and Copy tools will not overwrite EANs for products with existing EANs. You can use the Delete tool to clear the existing EANs before generating or copying.
- Generate
- Generate EAN for all products.
- Default:
no
- Default:
- Generate: Type
- Possible values: EAN-8; UPC-A; EAN-13.
- Default:
EAN-13
- Default:
- Generate: Country prefix (from)
- List of GS1 country codes.
- Default:
200
- Default:
- Generate: County prefix (to) (optional)
- If set, the plugin will generate the prefix randomly between “Prefix from” and “Prefix to” values.
- Default: None
- Generate: Seed prefix (optional)
-
- Default: None
- Generate: Automatically generate EAN for new products
-
- Default:
no
- Default:
- Generate: Automatically generate EAN on product update
-
- Default:
no
- Default:
- Copy product SKU
- Copy EAN from product SKU for all products.
- Default:
no
- Default:
- Copy product SKU: Automatically copy SKU to EAN for new products
-
- Default:
no
- Default:
- Copy product SKU: Automatically copy SKU to EAN on product update
-
- Default:
no
- Default:
- Copy product ID
- Copy EAN from product ID for all products.
- Default:
no
- Default:
- Copy product meta
- Copy EAN from product meta for all products.
- Default:
no
- Default:
- Copy product meta: Meta key
- Product meta key to copy from, e.g.
_gtin
.- Default: None
- Assign from the list
- Assign EAN from the list for all products.
- Default:
no
- Default:
- Assign from the list: List
- EAN list to assign from. One EAN per line. Used (i.e. assigned) EANs will be automatically removed from the list.
- Default: None
- Delete
- Delete all EANs for all products.
- Default:
no
- Default:
- “Products > Bulk actions”
- Sets actions to be added to the “Products > Bulk actions” dropdown. Possible values: Generate EAN; Delete EAN.
- Default:
Delete EAN; Generate EAN
- Default:
Product Actions
- Automatic actions: New product
- Sets actions to be automatically performed when new product is added. New product Possible values: Disabled; Generate; Copy product SKU; Copy product ID; Copy product meta; Assign from the list.
- Default:
Disabled
- Default:
- Automatic actions: Update product
- Sets actions to be automatically performed when the product is updated. Possible values: Disabled; Generate; Copy product SKU; Copy product ID; Copy product meta; Assign from the list.
- Default:
Disabled
- Default:
- Periodic action
- Sets the action to be automatically performed on a periodic basis (for all products). Possible values: Disabled; Generate; Copy product SKU; Copy product ID; Copy product meta; Assign from the list.
- Default:
Disabled
- Default:
- Periodic action interval in seconds
-
- Default:
3600
- Default:
- “Products > Bulk actions”
- Sets actions to be added to the “Products > Bulk actions” dropdown. Possible values: Generate EAN; Delete EAN.
- Default:
Delete EAN; Generate EAN
- Default:
Order Tools
- Add EANs
- Add EANs to all order items.
- Default:
no
- Default:
- Delete EANs
- Delete EANs from all order items.
- Default:
no
- Default:
Developers
Plugin stores EANs in product meta with _alg_ean
key. So if you’d need to access it directly:
$ean = get_post_meta( $product_id, '_alg_ean', true );
FAQ
Q. I am trying to add the EAN field to another plugin (e.g. product feed plugin), but I’m not able to find the EAN in the custom fields list there.
A. It looks like some plugins don’t “like” the starting underscore _
symbol in our _alg_ean
meta key. So here is what you can do – in “WooCommerce > Settings > EAN > Advanced” you will find an option – “Meta key” – set it to something without the starting underscore symbol, e.g. alg_ean
. Then set EAN for some product in your shop, and, after that, you should be able to select it in your other plugin.
If you still can’t find the EAN in the custom fields list, based on our experience, there are a couple of different solutions to it:
- Some plugins are gathering new custom fields on a periodic basis. This means that after you change our meta key to a new one, and set the EAN for one of your products, you may need to wait for a while before the EAN will appear in the custom fields section.
- Some plugins have some kind of a button to force new custom fields search – you may need to click it. For example, the WooCommerce Google Product Feed plugin has the “refresh the field list” link in “WooCommerce > Settings > Product Feeds”.
- And, finally, some plugins are checking a number of the newest products to get custom fields, so the safest solution is to add the EAN to the latest product you have in your shop. For example, the Product Feed PRO for WooCommerce plugin checks five of your latest products.
Notes
- After you change the key from
_alg_ean
toalg_ean
, all your existing product EANs will disappear. If you want to keep them – there is a way – you need to use our “WooCommerce > Settings > EAN > Tools” section. There is a tool – “Product Tools > Copy product meta > Copy EAN from product meta for all products”. You need to set the “Meta key” option to the old key (i.e._alg_ean
) and run the tool – it will copy all old EANs to the new ones. - Some plugins (e.g. WooCommerce Google Product Feed) will work with our original meta key (with the underscore symbol) as well – look for the “EAN” field there (not
_alg_ean
).
Q. What GTIN types are supported?
A. Despite the (EAN) naming, the plugin supports all main product GTINs.
- EAN-8 – A shorter version of the EAN-13 standard. Length: 8.
- UPC-A – The most common type in the United States. Length: 12.
- EAN-13 – The most commonly used EAN standard. Length: 13.
- ISBN-13 – The International Standard Book Number (ISBN) is a numeric commercial book identifier. It’s a subset of EAN-13. Length: 13.
- JAN – The Japanese Article Number (JAN) is a subset of EAN-13. Length: 13.
- Custom – Custom can represent all 128 ASCII code characters (numbers, upper case/lower case letters, symbols, and control codes). Length: Any.
Q. What’s EAN?
A. The International Article Number (also known as European Article Number or EAN) is a standard describing a barcode symbology and numbering system used in global trade to identify a specific retail product type, in a specific packaging configuration, from a specific manufacturer. The same numbers can be referred to as GTIN. EAN barcodes are used worldwide for lookup at retail point of sale, but can also be used as numbers for other purposes such as wholesale ordering or accounting.
Changelog
5.1.1 - 10/09/2024
- Dev - Advanced - Admin settings descriptions updated.
5.1.0 - 06/09/2024
- Dev - Pro - "TCPDF" library updated (to v6.7.5).
- Dev - Pro - Print - Options are sanitized now.
- Plugin short description updated.
5.0.0 - 03/09/2024
- Dev - Pro - Barcodes -
[alg_wc_ean_barcode_2d]
-content
-title
option added. - Dev - Pro - Barcodes -
[alg_wc_ean_barcode_2d]
-content
-formatted_name
option added. - Dev - Pro - Barcodes -
[alg_wc_ean_barcode_2d]
-content
-attribute_summary
option added. - Dev - Pro - Developers -
alg_wc_ean_barcode_shortcode_content
filter added. - Dev - Pro - Developers -
alg_wc_ean_barcode_2d_shortcode_content
filter added. - WC tested up to: 9.2.
4.9.9 - 31/07/2024
- Fix - Shortcodes - Sanitizing shortcodes output -
data
protocol added (fixes the issue with barcode images in the Pro version). - Dev - Pro - Barcodes - Admin product edit page - "Template" options added.
- Dev - Pro - Shortcodes - Barcodes -
add_text
attribute added to the[alg_wc_ean_barcode]
and[alg_wc_ean_barcode_2d]
shortcodes (defaults tono
). - Dev - Pro - Developers -
alg_wc_ean_barcode_args
filter added.
4.9.8 - 30/07/2024
- Tested up to: 6.6.
- WC tested up to: 9.1.
4.9.7 - 27/06/2024
- Fix - EAN-14 validation fixed when the "Type" is set to "Automatic".
- WC tested up to: 9.0.
4.9.6 - 14/06/2024
- WC tested up to: 8.9.
- WooCommerce added to the "Requires Plugins" (plugin header).
4.9.5 - 16/05/2024
- Readme.txt - Content updated.
4.9.4 - 26/04/2024
- Dev - Compatibility - "Google Product Feed" option added (defaults to
yes
). - Dev - Compatibility - "Woocommerce OpenPos" option added (defaults to
yes
). - WC tested up to: 8.8.
4.9.3 - 15/04/2024
- Security - Shortcodes - Sanitizing shortcodes output (
wp_kses_post()
). - Security - Shortcodes -
[alg_wc_ean_product_meta]
- Ensuring that only product meta is retrieved (get_post_meta()
replaced with$product->get_meta()
). - Tested up to: 6.5.
- Readme.txt - Changelog - Truncated (full changelog moved to the
changelog.txt
file).
4.9.2 - 29/03/2024
- Dev - Admin products list column - "Show duplicates" option added (defaults to
yes
). - WC tested up to: 8.7.
- Readme.txt - Tags updated.
4.9.1 - 01/02/2024
- Dev - Order Tools - "Search" tool added.
- Dev - Admin settings - Tools - Section split: "Order Tools" section added.
4.9.0 - 30/01/2024
- Dev - Advanced - Export/Import/Reset Plugin Settings - Import - Better data validation.
- WC tested up to: 8.5.
4.8.9 - 06/01/2024
- Dev - Orders - Now using "General > Title" for order item meta labels.
4.8.8 - 22/12/2023
- Dev - Display - Single product page - Variable products: Position in variation - Description - Now checking if EAN is not empty.
- WC tested up to: 8.4.
4.8.7 - 12/12/2023
- Dev - PHP 8.2 compatibility - "Creation of dynamic property is deprecated" notice fixed.
4.8.6 - 29/11/2023
- Dev - General - "Checkout" option added (defaults to
no
).
4.8.5 - 28/11/2023
- Dev - General - Cart - "Template" option added.
4.8.4 - 27/11/2023
- Fix - Pro - Print - Print buttons: Single order - HPOS compatibility.
- WC tested up to: 8.3.
4.8.3 - 09/11/2023
- Dev - Tools - Product Tools - Copy to product meta - "Meta sub key (optional)" option added.
- Tested up to: 6.4.
4.8.2 - 20/10/2023
- Dev - REST API - Orders - Add EAN to each order object in REST API responses - Extra checks added to prevent possible PHP warning.
4.8.1 - 19/10/2023
- Dev - Admin settings - General - Admin product edit page - Add pattern - Description updated.
- WC tested up to: 8.2.
4.8.0 - 05/10/2023
- Dev - General - Admin product edit page - Add pattern - Default value changed to
no
.
4.7.9 - 25/09/2023
- Plugin icon, banner updated.
4.7.8 - 25/09/2023
- Fix - Admin settings - Compatibility - Google Listings & Ads - Typo fixed.
4.7.7 - 19/09/2023
- Dev - Compatibility - Google Listings & Ads - Different approach implemented.
4.7.6 - 15/09/2023
- Dev - Search - Code refactoring.
- Dev - Pro - Extra Fields - "Admin product search" options added (default to
no
). - Dev - Pro - Extra Fields - "Search" (frontend) options added (default to
no
). - WC tested up to: 8.1.
4.7.5 - 05/09/2023
- Dev - Compatibility - "Google Listings & Ads" option added.
- Dev - Developers -
alg_wc_ean_product_structured_data_value
filter added. - Dev - Developers -
alg_wc_ean_product_structured_data_markup_value
filter added. - Dev - Developers -
alg_wc_ean_product_structured_data_allow_empty_value
filter added.
4.7.4 - 30/08/2023
- Dev - Pro - Print - Cell - "Cell top/left/right/bottom margin" options added (all default to
0
). - Dev - Pro - Print - Cell - "Cell content alignment" option added.
- Dev - Pro - Print - Admin settings descriptions updated.
4.7.3 - 23/08/2023
- Fix - Declaring HPOS compatibility for the free plugin version, even if the Pro version is activated.
- Dev - Compatibility - "MultiVendorX" options added.
- Dev - Admin settings - Advanced - Meta key - Description updated.
4.7.2 - 09/08/2023
- Fix - Tools - Product Tools - Assign from the list - Product categories - Variations - Checking for the
variable
product type. - Dev - Tools - Product Tools - Assign from the list - Product categories - Variations - Ensuring that products are always sorted by ID (ASC).
- Tested up to: 6.3.
- WC tested up to: 8.0.
4.7.1 - 15/07/2023
- Fix - Search / Admin product search / Admin products list column (sorting) - Handling cases when
query['post_type']
is an array.
4.7.0 - 13/07/2023
- Dev - "EAN-14" type added.
- Dev - Code refactoring.
4.6.0 - 23/06/2023
- Dev - Display - Shortcodes are now processed in the "Single product page" and "Shop pages" options.
- Dev - Display - Shop pages - "Template" option added. Defaults to
EAN: %ean%
. - Dev - Tools - Product Tools - Copy from product attribute - "Custom product attribute" option added.
- Dev - Shortcodes -
[alg_wc_ean_if]
shortcode added. - Dev - Shortcodes -
[alg_wc_ean_if_product_cat]
shortcode added. - Dev - Shortcodes -
[alg_wc_ean_if_product_tag]
shortcode added. - Dev - Shortcodes -
[alg_wc_ean_product_terms]
shortcode added.
4.5.1 - 18/06/2023
- WC tested up to: 7.8.
4.5.0 - 07/06/2023
- Dev - "High-Performance Order Storage (HPOS)" compatibility.
- Dev - Admin Settings - Option descriptions updated.
- Dev - Code refactoring.
- WC tested up to: 7.7.
4.4.6 - 02/05/2023
- Dev - Shortcodes -
[alg_wc_ean_is_valid]
shortcode added. - Dev - Shortcodes -
[alg_wc_ean_is_unique]
shortcode added. - Dev - Compatibility - Dokan - "Description" option added.
- Dev - Compatibility - Dokan - "Required HTML" option added.
- WC tested up to: 7.6.
4.4.5 - 06/04/2023
- Fix - Display - Frontend hooks (including barcodes) now are loaded on AJAX as well.
- Dev - Developers - REST API -
alg_wc_ean_rest_api_product_ean_key
filter added. - Dev - Developers - REST API -
alg_wc_ean_rest_api_order_ean_key
filter added. - Dev - Admin Settings - General - Option descriptions updated.
- Tested up to: 6.2.
- WC tested up to: 7.5.
4.4.4 - 02/02/2023
- Dev - Developers - Admin product search -
alg_wc_ean_search_backend
filter added. - Dev - Developers - Search -
alg_wc_ean_search
filter added. - WC tested up to: 7.3.
4.4.3 - 10/01/2023
- Dev - Shortcodes -
[alg_wc_ean_product_image]
- Security -height
andwidth
attributes are escaped now. - WC tested up to: 7.2.
4.4.2 - 26/11/2022
- Dev - Tools - Product Tools - "Copy from product attribute" tool added.
4.4.1 - 25/11/2022
- Dev - Compatibility - Dokan - "Required" option added (defaults to
no
). - WC tested up to: 7.1.
- Tested up to: 6.1.
4.4.0 - 20/10/2022
- Dev - General - Admin product edit page - "Require" option added. Defaults to
no
. - Dev - General - Admin product edit page - "Add pattern" option added. Defaults to
yes
. - Dev - Advanced - JavaScript Variation Options - "Variations form" option added. Defaults to
.variations_form
. - WC tested up to: 7.0.
4.3.4 - 28/09/2022
- Dev - General - Admin product edit page - "Position (variation product)" option added. Defaults to "Variations: After pricing".
- WC tested up to: 6.9.
4.3.3 - 08/09/2022
- Fix - Tools - Product Tools - Assign from the list - Product categories - Variations category filtering fixed.
4.3.2 - 29/08/2022
- Dev - REST API - Products - Add EAN to each product object in REST API responses - EAN added to variation responses as well.
4.3.1 - 15/08/2022
- Dev - Pro - Print/Barcode Generator - Now checking if classes exist before including the TCPDF library.
- WC tested up to: 6.8.
4.3.0 - 03/08/2022
- Dev - REST API - Products - Search by EAN - Now including product variations as well.
- Dev - Pro - Print - Print Tools - "Products List" tool added.
- Dev - Pro - Print - Admin Options - Print buttons - Quantity input - "Products > Bulk actions > Each product" option added.
- Dev - Pro - Extra Fields - Admin settings section description updated.
4.2.0 - 27/07/2022
- Dev - Compatibility - "Woocommerce OpenPos" compatibility added ("EAN" field is now available in "POS > Setting > Barcode Label > Barcode Meta Key").
- Dev - Compatibility - WooCommerce PDF Invoices & Packing Slips - "Content" options added. Includes barcodes.
- Dev - Pro - Code refactoring:
- Barcode Generator.
- Shortcodes -
[alg_wc_ean_barcode]
and[alg_wc_ean_barcode_2d]
.
- WC tested up to: 6.7.
4.1.2 - 17/06/2022
- Dev - Tools - Product Actions - Bulk actions - "Require confirmation?" option added (defaults to "Delete EAN").
- Fix - Pro - Print - Print Tools - Quantity - Quantity input was ignored when products had identical EANs.
- Dev - Pro - Print - Admin Options - Print buttons - "Quantity input" option added.
4.1.1 - 16/06/2022
- Fix - Admin product search - Including all post statuses now (e.g., drafts).
- Dev - Tools - Product Tools - Copy to product meta - Meta key - Comma-separated list of keys is now accepted.
4.1.0 - 16/06/2022
- Dev - Tools - Product Tools - "Copy to product meta" tool added.
- Dev - Shortcodes -
[alg_wc_ean_product_sku]
- Optionalmax_length
attribute added. - Dev - Pro - Print - Print Tools - "Print" tool added.
- Dev - Pro - Developers - Print -
alg_wc_ean_print_get_products
filter added. - WC tested up to: 6.6.
4.0.0 - 10/06/2022
- Dev - General - Admin product edit page - 'Add "Generate" button' option added.
- Dev - Compatibility - WCFM - Variations are supported now.
- Dev - Compatibility - WCFM - 'Add "Generate" button' option added.
- Dev - Advanced - Export/Import Plugin Settings - "Reset" tool added.
- Dev - Advanced - Export/Import Plugin Settings - Code refactoring.
- Dev - Shortcodes -
[alg_wc_ean_product_author_id]
shortcode added. - Dev - Developers - Tools - Product Tools - Generate:
alg_wc_ean_product_tools_generate_ean_country_prefix
filter added.alg_wc_ean_product_tools_generate_ean_seed_prefix
filter added.alg_wc_ean_product_tools_generate_ean_seed
filter added.
- Dev - Pro - "Extra Fields" sections added.
- Dev - Pro - Shortcodes - Barcodes -
img_w
andimg_h
attributes added (both default tofalse
).