WPPizza – A Restaurant Plugin for WordPress › Support › Code Snippets WPPizza v2.x (read only)
(Code Snippets for v3.x) › auto print an order
- AuthorPosts
- 2 September, 2014 at 5:58 pm #4925
this isn’t really possible to do generically from what i can see, however, I have just come across some php code/function that may or may not be suitable.
it doesn’t seem to be well documented at all (and therefore might not even work at all), but i thought it’s worth posting
essentially, in conjunction with the following action hook, ‘wppizza_on_order_executed’ (see here https://www.wp-pizza.com/topic/after-every-order/)
you might have some luck with something like the following (tweak as needed)
function my_printorder_function() { $handle=printer_open("EPSON LX-300"); $font=printer_create_font("Draft Condensed",25,6,PRINTER_FW_THIN,false,false,false,0); printer_select_font($handle,$font); printer_write($handle,"Library & Learning Resource Center"); printer_write($handle,$name); printer_write($handle,$address); printer_write($handle,$orderId); /**some more things**/ printer_delete_font($font); printer_close($handle); }
from what i can see, you will need a network printer to start off with (possibly with some other non standard php extensions installed, i do not know)
this has not been tested at all, so no guarantees that this even works
if anyone does this and has success, please let me know
thanks
PS: if you are logged in to wordpress and the wppizza order history, some of these snippets might also help perhaps
https://www.wp-pizza.com/topic/play-sound-when-new-order-arrives-admin/
https://www.wp-pizza.com/topic/run-action-on-status-update-admin/
2 September, 2014 at 6:11 pm #4926PS: it also only seems to be a windows extension
full page here (where i got the above code from)
http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28394791.html
and some more info
http://stackoverflow.com/questions/23380862/send-pdf-file-to-printer26 May, 2015 at 3:14 pm #10195While browsing online over the weekend I stumbled upon this.
http://printnode.com
Interesting, and they have an API toohttps://www.printnode.com/docs/php-api-integration/
Any possibilities on getting wp-pizza to talk to printnode in the future?
26 May, 2015 at 3:30 pm #10198>Any possibilities on getting wp-pizza to talk to printnode in the future?
theoretically this is probably possible.
however, why do you want to pay $5/monoths for this when you can have it free with google cloudprint ?(but maybe there’s another useful feature they are offering that I am not seeing/missing that would make the 5/month worthwhile)
26 May, 2015 at 7:52 pm #10204This reply has been marked as private.27 May, 2015 at 1:16 am #10245This reply has been marked as private. - AuthorPosts
- The topic ‘auto print an order’ is closed to new replies.