• Resolved massivegeek

    (@massivegeek)


    Hello I use the “WooCommerce Order Barcodes” plugin and would like to add the barcode to the invoice print outs for scanning when packing orders. The barcode image is stored in the wp_postmeta table withe meta_key barcode_image the meta_value starts with “data:image/bmp;base64” followed by all the data.

    I have tried to use your example code in the FAQ but I cant seem to get it to show on the Invoice prints. A solution to this would be greatly appreciated

    • This topic was modified 6 years, 1 month ago by massivegeek.
Viewing 1 replies (of 1 total)
  • Thread Starter massivegeek

    (@massivegeek)

    I managed to get this working in the end, if anyone else stumbles across this the following code worked.

    function invoice_custom_order_fields( $fields, $order ) {
        $new_fields = array();
            
        if( get_post_meta( $order->id, '_barcode_image', true ) ) {
            $new_fields['Barcode'] = array( 
                'label' => 'Order Barcode',
          'value' => '<img src="/?wc_barcode='.get_post_meta( $order->id, '_barcode_text', true ).'" width="200" height="40" />'
            );
        }
        
        return array_merge( $fields, $new_fields );
    }
    add_filter( 'wcdn_order_info_fields', 'invoice_custom_order_fields', 10, 2 );
Viewing 1 replies (of 1 total)

The topic ‘Woocommerce Barcode’ is closed to new replies.