Adding barcode to print (Yith barcodes)
-
Hi,
I cant seem to manage to attach a barcode to the printed receipt.
I have recieved the following information
“You can add the order barcode in a third-party document like an invoice or receipt adding the next code in the functions.php of your active theme.
if ( ! function_exists( ‘yith_wc_barcodes_and_qr_filter_call_back’ ) ) {
function yith_wc_barcodes_and_qr_filter_call_back( $order_id ){
ob_start();
$css = ob_get_clean();
YITH_YWBC()->show_barcode( $order_id, true, $css );
}
add_action( ‘yith_wc_barcodes_and_qr_filter’,’yith_wc_barcodes_and_qr_filter_call_back’, 10, 1 );
}Then, you have to add the next hook where you like inside templates where you want to display the barcode.
do_action ( ‘yith_wc_barcodes_and_qr_filter’, $order_id );
Unfortunately, all i recieve is a error print on the bottom of the paper. I added the barcode hook in the after_template hook.
Any ideas why it doesnt print the barcode?
Best Regards
- The topic ‘Adding barcode to print (Yith barcodes)’ is closed to new replies.