• Resolved juareztw

    (@juareztw)


    Hello Ewout,

    First of all, great plugin keep up the good work!

    I’m using https://woocommerce.com/products/woocommerce-order-barcodes/ to generate barcodes per order. Now I would like to output the generated barcode in the invoice.

    I’ve tried the following snippet as stated in the documentation of this plugin:

    
    <?php
    echo WC_Order_Barcodes()->display_barcode($order_id);
    ?>
    

    But this doesn’t seem to do anything and will output:

    
    Notice: Undefined variable: order_id in /home/.../public_html/wp-content/themes/.../woocommerce/pdf/.../invoice.php
    on line 138
    

    Anyway you could help me sorting this out?

    Thanks in advance!

    • This topic was modified 8 years, 4 months ago by juareztw.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! $order_id is not directly available. In a custom template you can use $this->order->id, and in one of the action hooks you can use $order->id instead.
    Hope that helps!

    Ewout

    Thread Starter juareztw

    (@juareztw)

    You’re the best! Worked like a charm.

    Thankyou very much

    Plugin Contributor Ewout

    (@pomegranate)

    Great! Glad to hear that ??

    Ewout

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding WooCommerce Order Barcodes to the invoice’ is closed to new replies.