• Resolved studiokb

    (@studiokb)


    Hi,
    I am looking at getting the WC plugin “WooCommerce Order Barcodes” (https://docs.woocommerce.com/document/woocommerce-order-barcodes-2/), but want to know if it would be possible to add the barcode to the packing slip? In the documentation for that plugin it says “These barcodes can be used on e-tickets, e-reservations, packing slips”, and also that you can use the following PHP to output an order’s barcode anywhere:
    echo WC_Order_Barcodes()->display_barcode($order_id);

    I was hoping that that code could hook into your packing slip, like how you add custom fields to the packing slip. I wonder are you familiar with this plugin and know if it is possible to add the barcode to your packing slip?
    Thanks

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

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

    (@pomegranate)

    Yes you can either add this code directly to a custom template, or use one of the available action hooks.

    We also offer a no-coding solution with the Premium Templates extension: with this you can simply add a custom block with the {{wc_order_barcode}} placeholder:

    Thread Starter studiokb

    (@studiokb)

    Hi,
    Thanks for the info

    Hi,

    I’ve got a custom template set up which I know is working correctly but I have tried to add a barcode generated from WooCommerce Order Barcodes using:

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

    and can’t get it to display on a pdf. I tried every combination I can think of in place of $order_id ie; $this->order, $this->order->ID, $this->order->get_order_number() etc but nothing works.

    What’s the correct code for this please?

    Thanks

    Plugin Contributor Ewout

    (@pomegranate)

    Please contact WC Order Barcodes support for help with this.

    Okay, thanks.

    Hmmm. Have chatted to support but they say: “We confirmed that the code actually works outside of their pluginso it is not related to WooCommerce Order Barcodes not working rather their plugin not taking the barcode for some reason in the PDF file”.

    I tested the php snippet in the footer.php file of the theme with an actual order ID and it worked fine (showed the barcode image).

    Interestingly I’ve tested this in a local environment and this time where the barcode should output I get:

    Barcode
    Image not found or type unknown

    Plugin Contributor kluver

    (@kluver)

    Hi @tin_soldier

    In your custom template try:

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

    Still the same:

    Barcode
    Image not found or type unknown
    5e96e3b8f34ba

    on the local version, the staging (remote) version actually times out.

    Have just set ‘Output to HTML’ in the debug settings and the barcode comes through so it’s something to do with the image and the pdf creator. If I save the image from the html file I can see the format is .bmp

    Does the pdf output support .bmp or can it be added?

    Plugin Contributor Ewout

    (@pomegranate)

    Our plugin supports this format out of the box, but it’s possible there’s an issue with the certificate on your server (https vs http). Seeing an image in your browser is different from downloading it to your server (even when from the same server, in this case it’s still served via the internet), and when it can’t be read for whatever reason you may get this error. Unfortunately this is beyond the support of the free plugin.

    Okay will try the hosting support and see whether there’s anything going on there. I’ve just learned that the barcodes are actually served as SVG files (although trying to save from the browser created a .bmp). Does your plugin support .svg out of the box too.

    Thanks

    Plugin Contributor Ewout

    (@pomegranate)

    yes SVG is supported too

    Hi Ewout,
    I’ve purchased the plugin and I also want to put a QR-Code from WC-Order Barcodes on pdf-forms.

    You said “We also offer a no-coding solution with the Premium Templates extension: with this you can simply add a custom block with the {{wc_order_barcode}} placeholder”

    Where can I find these Custom Blocks to add the code?

    Thx for help

    Plugin Contributor kluver

    (@kluver)

    @steinfranken You will need to purchase our Premium Templates extension first. After activating it you can go to WooCommerce > PDF Invoices > Customizer and add a custom block in the ‘Custom block’ section.

    • This reply was modified 4 years, 2 months ago by kluver.
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Adding barcode to packing slip’ is closed to new replies.