PayPal Zettle POS for WooCommerce
Search

How to use barcodes from other plugins?

We provide the below WordPress filters which allow you to change how barcode values are retrieved. You can choose from where:

  • zettle-pos-integration.barcode.value – accepts WC_Product ( which can be a simple product or variation ), returns barcode value ( string ).
  • zettle-pos-integration.barcode.standard-input-ui-enabled – return false to hide our barcode input UI.

The filters can be added at any time before the WordPress init hook is triggered with priority 10.

Example using the GTIN field from a Germanized plugin:

add_filter('zettle-pos-integration.barcode.value', function (string $barcode, \WC_Product $product): string {
    return $product->get_meta('_ts_gtin');
}, 10, 2); 

add_filter('zettle-pos-integration.barcode.standard-input-ui-enabled', '__return_false');