• Resolved joerock94

    (@joerock94)


    is there any way I can create a barcode for the Order number on the invoice?

    I’ve tried the following code using a barcode generating plugin but I can’t get it to work, any advise?

    <?php echo do_shortcode("[barcode text=$this->order_number() type=code128 height=100 wdith=2 transparency=1]");?>

    the above makes a barcode for “()”

    • This topic was modified 7 years, 9 months ago by joerock94.
    • This topic was modified 7 years, 9 months ago by joerock94.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! the $this->order_number() bit doesn’t actually return any data and the data it outputs while it’s running doesn’t actually end up in the shortcode string, this is why it doesn’t work. Try this instead:

    
    <?php echo do_shortcode("[barcode text=".$this->order->get_order_number()." type=code128 height=100 wdith=2 transparency=1]");?>
    

    Let us know if that works for you!

    Thread Starter joerock94

    (@joerock94)

    HI Ewout,

    Works perfectly, thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)

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