• Resolved leihdichfrei

    (@leihdichfrei)


    Hi there,
    I wanted to use the SKU attribute as the barcode used in Zettle.
    Checked your documentation and the other threads and used Code Snippets to run the following script with priority 10:

    add_filter('zettle-pos-integration.barcode.value', function (string $barcode, \WC_Product $product): string {
        return $product->get_meta('_sku');
    }, 10, 2); 
    
    add_filter('zettle-pos-integration.barcode.standard-input-ui-enabled', '__return_false');

    Nevertheless the SKU still can’t be used as the barcode and in the Zettle App the barcode field on products is still empty. What am I missing?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Syde Joost

    (@joostvandevijver)

    Hello @leihdichfrei,

    thank you for reaching out to us, we are here to help.

    Please try changing it to:

    add_filter('zettle-pos-integration.barcode.value', function (string $barcode, \WC_Product $product): string {
        return $product->get_sku();
    }, 10, 2); 
    
    add_filter('zettle-pos-integration.barcode.standard-input-ui-enabled', '__return_false');

    It should work like this.
    Let me know if you need any more support from our end.

    Kind regards,
    Joost

    Thread Starter leihdichfrei

    (@leihdichfrei)

    Hey @joostvandevijver,
    thank you so much for the quick response.
    Your suggestion did the trick – it works now as expected! ??

    Best regards,
    Martin //leihdichfrei

    Plugin Support Syde Joost

    (@joostvandevijver)

    You are very welcome @leihdichfrei, I will mark this thread as resolved.

    If you are happy with the plugin and our support, please don’t hesitate to give us a review on WordPress to promote our plugins. It’s very much appreciated and will help us a great deal.

    Kind regards,
    Joost

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set SKU as barcode field’ is closed to new replies.