• Resolved johnc1979

    (@johnc1979)


    Hi,
    How do I add a barcode from the woocommerce order barcode extension to the shipping label? I tried adding.

     add_filter( 'wf_pklist_label_add_additional_information', 'wf_add_barcode',10,1 );
    
     function wf_add_barcode()
     {	
     	
     	echo WC_Order_Barcodes()->display_barcode($order_id);
    
     }

    But it didn’t work.
    If it’s not possible on the free version will it work on th epaid version?
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @johnc1979,

    Please try using below code snippet.

    add_filter('wf_pklist_add_additional_info', 'wf_add_barcode', 10, 3);
    function wf_add_barcode($additional_info, $template_type, $order)
    {
    	if($template_type=='shippinglabel')
    	{
    		$order_id = (WC()->version < '2.7.0') ? $order->id : $order->get_id();
    		if(function_exists('WC_Order_Barcodes'))
    		{
    			$barcode = WC_Order_Barcodes()->display_barcode($order_id);
    			if(!empty($barcode))
    			{
    				$additional_info.=$barcode;
    			}
    		}
    	}
    	return $additional_info;
    }
    Majid

    (@majidempire)

    Hi
    How we can control the size of barcode ?
    I can’t find anything in WC barcode plugin

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add barcode to shipping label from woocommerce barcode extension’ is closed to new replies.