Update selected printer programmatically, my solution
-
If you have multiple locations but only want to print to just ONE printer, there is a simple way to do this.
Assume there is Locations A and B and I want the website order to print to Location B because customer has requested fulfillment from Location B:
In your functions.php or within your plugin structure, include the following code:
$location_name= ‘Location B’;
//$location_name; this would be the printer name in the settings page, it can be anything you want
update_option( ‘star-cloudprnt-printer-select’, $location_name);
//this calls the update function and passes a new value to the selected printer name argument
Not sure if anyone else intends to use the printers in this fashion but there it is incase you are wondering!
- The topic ‘Update selected printer programmatically, my solution’ is closed to new replies.