auto print an order

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4925

    Olly
    Admin & Mod

    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/

    #4926

    Olly
    Admin & Mod

    PS: 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-printer

    #10195

    mps1
    Participant

    While browsing online over the weekend I stumbled upon this.
    http://printnode.com
    Interesting, and they have an API too

    https://www.printnode.com/docs/php-api-integration/

    Any possibilities on getting wp-pizza to talk to printnode in the future?

    #10198

    Olly
    Admin & Mod

    >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)

    #10204

    mps1
    Participant
    This reply has been marked as private.
    #10245

    Olly
    Admin & Mod
    This reply has been marked as private.
Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘auto print an order’ is closed to new replies.