Last active
February 8, 2021 09:02
-
-
Save hedqvist/a2453f0e8efcf3b5650f102c5c8248b0 to your computer and use it in GitHub Desktop.
WP Overnight - Barcode in Invoice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function redlight_overnight_barcode_scanner_wc_barcode( $template_type, $order ) { | |
| if(function_exists('WC_Order_Barcodes')){ | |
| echo '<style type="text/css">.barcode>img{max-width:100%;max-height:100%;}</style>'; | |
| echo '<div class="barcode" style="width:250px;text-align: center;">'; | |
| echo WC_Order_Barcodes()->display_barcode($order->get_id(),$order->get_order_number(),'',true); | |
| echo '</div>'; | |
| } | |
| } | |
| add_action( 'wpo_wcpdf_after_document_label', 'redlight_overnight_barcode_scanner_wc_barcode', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment