I am using ACF to add barcode information to the WooCommerce product page. It has to be with the terms here:
Has to follow the one here: https://support.convictional.com/woocommerce/adding-barcode-values-in-woo-commerce#adding_barcode_values_in_woo_commerce
with terms as they asked.
[{ "id": 1,
"key": "barcode",
"value": "12345678912"
},
{
"id": 2,
"key": "barcode_type",
"value": "upc"
}]
Could any experts here let me know how and where to set it up please?
I did set up test area in the ACF with barcode
and barcode_type
but showing differently on the page.
2
Answers
Wo...This is so Awesome! @LoicTheAztec, thank you so much. They works perfectly.
ACF is not convenient for this purpose as the real meta key will never be like
"barcode"
or"barcode_type"
, but something like:"field_648f2aaff9f4b"
as you can see in this thread or in this other thread…Based on In WooCommerce product options edit page display a custom field before the SKU answer, you can easily add 2 custom fields in the product settings under Inventory section.
This way, you will have the correct meta keys to be recognized and used via REST API.
The code:
To display the barcode in single product pages in the meta section (near the SKU):
Code goes in functions.php file of your child theme (or in a plugin). Tested and works.
Other related threads around GTIN and barcode