Forum Replies Created

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)