Olly

Forum Replies Created

Viewing 20 posts - 1,361 through 1,380 (of 4,446 total)
  • Author
    Posts
  • in reply to: GoodCom printers #35526
    Olly
    Admin & Mod

      @proof
      ah, i know where you are going wrong here regarding my note to the benefits of //declare new ORDER class and assign order details to var order and assuming your action hook usage is as you posted it

      it should be

      add_action( 'wppizza_on_order_execute', 'print_order', 10, 3);
      /*or if you want */
      add_action( 'wppizza_on_order_execute', 'print_order', 1, 3);
      

      not
      add_action( 'wppizza_on_order_execute', 'print_order', 1);
      otherwise the 2nd and 3rd parameter will not be available to you !!!

      in reply to: GoodCom printers #35524
      Olly
      Admin & Mod

        As a sidenote while I am here, I would also suggest something a bit more dynamic regarding the “all other order details” as they are variable and not always the same everywhere
        perhaps something along these lines (will no doubt need tweaking according to what goodcom printers really need, but as a starting point)

        
        $additional_data = array();
        
        /* customer data */
        $customer_data = array();
        foreach($order[customer] as $k=>$v){
          $customer_data[$k]=$v['value'];//or value_formatted
        }
        $additional_data[] = '{'.implode('};{', $customer_data).'}';//tweak as required
        
        /* order vars */
        $ordervars= array();
        foreach($order[ordervars] as $k=>$v){
          $ordervars[$k]=$v['value'];//or value_formatted
        }
        $additional_data[] = '{'.implode('};{', $ordervars).'}';//tweak as required
        
        /* add $order[summary] too (this will always be 2 levels deep to account for multiple taxrates for example) so somewhat as above but a 2 level/nested foreach loop*/
        
        /* then put it together - assuming it needs "*" between things - probably needs tweaking too as i dont know what those printers need but I would think one gets the idea*/
        $txt .= implode('*', $additional_data);
        
        
        in reply to: GoodCom printers #35522
        Olly
        Admin & Mod

          Hi
          don’t mean to criticize and as mentioned I know nothing about those printers.
          maybe I’m missing something, but what’s the supposed benefit of doing this ?

          
          	//declare new ORDER class and assign order details to var order
          	$order = new WPPIZZA_ORDER();
          	$order = $order->session_formatted();
          
          in reply to: verify by sms #35515
          Olly
          Admin & Mod

            as it happens i’ve just finished something would allow you to do that (and a bunch of other things)
            that includes twilio,clickatell or tm4b (or simple email confirmation)

            might be a couple of days or so until it’s available though

            in reply to: GoodCom printers #35487
            Olly
            Admin & Mod

              @proof

              thanks for chiming in.
              after all i can only give abstract advice as i know nothing about these printers so anything more concrete would be appreciated
              cheers

              in reply to: GoodCom printers #35486
              Olly
              Admin & Mod

                simply save the $order_details array into a file somewhere and have a look at the array
                it should be quite self explanatory what is what

                i.e something like file_put_contents(‘../ordini.txt’, print_r($order_details , true));

                and then build your actual string as you need it

                (and perhaps the same with the other parameters like the $print_templates vars etc etc )

                in reply to: GoodCom printers #35482
                Olly
                Admin & Mod

                  please check what $order_details actually contains

                  stuff like

                  $txt .= $order_details[‘$delivery_type’];

                  makes no sense

                  and using print_r in a variable should also be print_r($var, true) in any event

                  in reply to: GoodCom printers #35475
                  Olly
                  Admin & Mod

                    @justin
                    technically speaking you should really start your own topic, but given that this is somewhat closely related let’s keep it going here for now as it might be interesting for anyone else that deals with goodcom printers (sorry proof)

                    now, regarding your code above (@justin)
                    a) your $txt = ... and file_put_contents.. will do nothing (for starters your return statement is before the file_put_contents..)

                    b) your $template_ids[] = 1; however makes the third parameter in wppizza_on_order_execute https://docs.wp-pizza.com/developers/?section=action-wppizza_on_order_execute contain the template stuff.
                    so you can now use that parameter in that wppizza_on_order_execute hook

                    i.e simplify your above filter to just be

                    
                    add_filter('wppizza_on_order_execute_get_print_templates_by_id', 'my_prefix_my_filter');
                    function my_prefix_my_filter($template_ids){
                    	$template_ids[] = 1;
                    	return $template_ids;
                    }

                    and then do what you need to do with third parameter in the wppizza_on_order_execute
                    i.e

                    
                    add_action('wppizza_on_order_execute', 'my_prefix_my_action', 10, 3);
                    function my_prefix_my_action($order_id, $order_details, $print_templates){
                    	/* 
                    	do something here with the now available $print_templates parameter 
                    
                    	like  file_put_contents('../ordini.txt', $mystuff, FILE_APPEND);
                    	
                    	etc etc etc 
                    */
                    }
                    
                    in reply to: GoodCom printers #35473
                    Olly
                    Admin & Mod

                      but of course , if proof wants to chime in here with a v3 implementation
                      please do

                      in reply to: GoodCom printers #35472
                      Olly
                      Admin & Mod

                        please read the thread .
                        it says it all there . i.e

                        https://docs.wp-pizza.com/developers/?section=action-wppizza_on_order_execute

                        in reply to: wppizza_on_order_execute #35402
                        Olly
                        Admin & Mod

                          >What if I downgread to wppizza v2?
                          unless you have a backup from before you upgraded to v3, you cant
                          as is clearly stated
                          https://docs.wp-pizza.com/getting-started/?section=upgrade-v2-x-v3-x

                          in reply to: wppizza_on_order_execute #35400
                          Olly
                          Admin & Mod
                            This reply has been marked as private.
                            in reply to: wppizza_on_order_execute #35398
                            Olly
                            Admin & Mod
                              This reply has been marked as private.
                              in reply to: Hide description on mobile-devices #35396
                              Olly
                              Admin & Mod

                                https://www.w3schools.com/css/css_rwd_mediaqueries.asp

                                for any further information regarding css and media queries, please use your favourite search engine
                                there are thousands of articles on the net regarding this , all of which will explain things in detail

                                in reply to: Hide description on mobile-devices #35394
                                Olly
                                Admin & Mod

                                  use css and media queries

                                  in reply to: SMTP not working, Error 503 #35391
                                  Olly
                                  Admin & Mod

                                    seems to me that perhaps your certificate on your server is the problem or ssl is not enabled but it’s just a guess

                                    in reply to: SMTP not working, Error 503 #35390
                                    Olly
                                    Admin & Mod

                                      i just found somthing here
                                      https://wordpress.org/support/topic/smtpautotls-overrides-smtpsecure-no-tlsssl-in-php-56/
                                      (filter at the end of page)

                                      other than that, google is your friend

                                      in reply to: SMTP not working, Error 503 #35388
                                      Olly
                                      Admin & Mod

                                        hacking core files is a VERY VERY bad idea (you will have the same problem every time wordpress updates)

                                        in reply to: SMTP not working, Error 503 #35386
                                        Olly
                                        Admin & Mod

                                          All I can suggest is to look at your mail(error)logs and speak to your host

                                          I know absolutely nothing about your server / server setup and if it’s not only the wppizza smtp settings but also other smtp plugins that throw errors then there’s clearly something wrong in your setup/credentials somewhere

                                          in reply to: Style problem #35382
                                          Olly
                                          Admin & Mod

                                            there is no such thing as “Standard” style please refer to the shortcode documentation
                                            https://docs.wp-pizza.com/shortcodes/

                                          Viewing 20 posts - 1,361 through 1,380 (of 4,446 total)