Last active
August 24, 2020 08:19
-
-
Save hedqvist/b46deed6b5ad17fb6da0ae61413f0d23 to your computer and use it in GitHub Desktop.
Automatic Printing - Different printer for packingslip
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 | |
| /** | |
| * @snippet WooCommerce - Print to different printerID if we are printing a packingslip | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.4.0 | |
| */ | |
| function redlight_print_packingslip_to_custom_printer($printjob, $order) { | |
| if( strpos($printjob['title'], 'Packingslip') !== false) { | |
| $printjob['printerId'] = 123456; | |
| } | |
| return $printjob; | |
| } | |
| add_filter('redlight_wc_automatic_printing_data', 'redlight_print_packingslip_to_custom_printer', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment