Printing the same order on two printers

WPPizza – A Restaurant Plugin for WordPress Support Add-Ons Extensions Google Cloudprint Printing the same order on two printers

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #29704
    Pawel Cichonski
    Participant

      Printing same order on two printers, is it possible? Let’s say I have two printers, one in the kitchen and one behind the bar, both printers connected to laptops/internet. Is it possible to set up to print the same order on both printers?

      You mentioned somewhere else:
      “as of v3.5.3 you can use the filter wppizza_gcp_filter_copies to set your printerid per copy printed”

      How to do this please?
      Thank you for your time

      #29705
      Olly
      Admin & Mod

        you need to set the printer id per copy
        the filter looks like this

        $printerid = apply_filters('wppizza_gcp_filter_copies', $printerid, $cp);
        where $printerid is – obviously – the printer id and $cp is a simple count depending on how many copies you have set to print

        #29707
        Olly
        Admin & Mod

          so the filter function should be something along the lines of (if you have it set for 2 copies)

          
          if($cp == 1){
          return 'some other printer id';
          }else{
          return $printerid;
          }
          #29717
          Pawel Cichonski
          Participant
            This reply has been marked as private.
            #29718
            Olly
            Admin & Mod

              no, you are supposed to use a filter.
              NEVER EVER edit core files themselves – that’s why filters exist and are left in plugins (among other things).

              https://www.google.co.uk/search?site=&source=hp&q=wordpress+how+to+use+filters

              if you want to do ANY kind of customisation in wordpress you MUST learn about filters and action hooks

              #29719
              Olly
              Admin & Mod

                you are supposed to USE the filter in your theme’s (or actually your child theme’s) functions.php file , not replace it. that defeats the point of having filters in there in the first place

                #29720
                Olly
                Admin & Mod
                  #29721
                  Olly
                  Admin & Mod

                    in short, you need to put something like this in your functions.php

                    
                    function myprefix_wppizza_gcp_filter_copies( $printerid, $cp ) {
                    if($cp == 1){
                    return 'some other printer id'; 
                    }else{
                    return $printerid;
                    }
                    }
                    add_filter( 'wppizza_gcp_filter_copies', 'myprefix_wppizza_gcp_filter_copies'. 10, 2 );
                    
                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • The topic ‘Printing the same order on two printers’ is closed to new replies.