By default WooCommerce POS will use the SKU field as the barcode. If you wish to use a custom barcode field you can use the woocommerce_pos_product_barcode
filter combined with the get_post_meta function. See below for an example of how you might use your own custom barcode field.
<?php | |
// this would go in your theme functions.php file | |
/** | |
* Custom product meta field to use as barcode | |
* | |
* By default WooCommerce POS will use the SKU field- '_sku' | |
* You can change the meta key using the following WordPress filter | |
* | |
* Below are meta fields from popular barcode plugins | |
* '_ywbc_barcode_value' – YITH WooCommerce Barcodes Premium | |
*/ | |
function my_custom_pos_barcode_meta_key(){ | |
return '_barcode'; // change for your custom meta key | |
} | |
add_filter('woocommerce_pos_barcode_meta_key', 'my_custom_pos_barcode_meta_key' ); |
Please note: a barcode must be unique for each product.