• Resolved agusapri

    (@agusapri)


    Hi,

    I use WooCommerce Barcode & ISBN plugin. On my webpage displays Product Name, SKU, Categories and Weight. On the invoice displays Product Name, SKU, Categories and Weight and Barcode (displayed as combination of numbers). Is there a way to add Barcode (displayed as combination of numbers) on the invoice also?

    Thanks for nice, smooth and easy to configure plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Darren Peyou

    (@dpeyou)

    Hello @agusapri,

    Do you by any chance know the meta key under which the barcode is saved in the order? Finding WooCommerce Custom Fields

    Is this an order barcode or a product barcode?
    Displaying Product custom fields
    Displaying Custom fields

    Thread Starter agusapri

    (@agusapri)

    It’s Product Barcode.

    Please see this screenshot, https://kutabali.my.id/Screenshot.png for Order Post Meta Key (I am not sure how tell you).

    • This reply was modified 1 year, 2 months ago by agusapri.
    • This reply was modified 1 year, 2 months ago by agusapri.
    • This reply was modified 1 year, 2 months ago by agusapri.
    • This reply was modified 1 year, 2 months ago by agusapri.
    • This reply was modified 1 year, 2 months ago by agusapri.
    • This reply was modified 1 year, 2 months ago by agusapri.
    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for confirming that it is a product barcode, @agusapri!

    Please try adding this code snippet to display the product barcode after the item meta:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Add the product barcode (number) after the item meta
     */
    add_action( 'wpo_wcpdf_after_item_meta', function( $template_type, $item, $order ) {    
        if ( isset( $item['product'] ) && ! empty( $barcode = $item['product']->get_meta( 'barcode' ) ) ) {
            echo "<div class=\"barcode\">Barcode: {$barcode}</div>";
        }
    } , 10, 3 );

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Thread Starter agusapri

    (@agusapri)

    Perfect! Works nicely! Thanks so much guys!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    We’re glad to hear that it worked!

    Feel free to contact us again if you need something else 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding One Line Below Weight’ is closed to new replies.