Olly

Forum Replies Created

Viewing 20 posts - 1,321 through 1,340 (of 4,453 total)
  • Author
    Posts
  • in reply to: wppizza_on_order_execute #35686
    Olly
    Admin & Mod

      that’s got nothing to do with anything

      again, what do you get when you add
      file_put_contents(‘path/to/some/file.log’, print_r($details_completed, true));
      directly at the top of your function you are calling with the on_order_Execute hook

      i.e

      
      add_action( 'wppizza_on_order_execute', 'my_order_app', 10, 3);
      function my_order_app($order_id, $details_completed, $tid) {
      file_put_contents('path/to/some/file.log', print_r($details_completed, true));
      }
      

      post the whole data that you receive in this file

      in reply to: Pickup Prices Extension prices #35674
      Olly
      Admin & Mod

        furthermore -as a more direct answer to the question

        a) there’s no provision for that because
        b) in 99% of cases (exceptions prove the rule and all that and might work for some prices) it will not be what’s required anyway
        assuming you have prices like 9.95, 7.95 and 5.95 if one were to blanket apply 10% you’d end up with 8.96, 7.16, 5.36
        I dont think anyone will want these kind of odd prices so you’d have to do most of them manually anyway

        in reply to: Pickup Prices Extension prices #35673
        Olly
        Admin & Mod

          doesnt it make more – or at least just as much – sense to simply apply a discount of 10% if pickup across the board ??

          in reply to: wppizza_on_order_execute #35638
          Olly
          Admin & Mod

            >Any update yet about the issue?
            no, becuase epay.dk have not replied to my re-activation of my test account nor have they setup a new test account i applied for (yet, on both counts)

            re class: correct

            have you tried a simple
            file_put_contents('path/to/some/file.log', print_r($details_completed, true));

            right after
            function my_order_app($order_id, $details_completed) {

            and had a look at that file

            Olly
            Admin & Mod

              >However, when I add items on the view-only page and then navigate to regular order page, these items will be in the cart.
              i cannot see how.
              please show me the page / url where you experience this behaviour

              Olly
              Admin & Mod

                simply dont put a cart of the view only page

                in reply to: GoodCom printers #35544
                Olly
                Admin & Mod
                  in reply to: GoodCom printers #35533
                  Olly
                  Admin & Mod

                    I’m not disputing that it works for you (how could I . I dont have one of these printers)
                    All I’m saying is that you are causing unnecessary overheads by getting the parameters again when they already exist
                    and if you one day decide to add another customer formfield for example (or remove one for that matter) you will have to add it to this script again wheras a simple foreach loop in the first place would already take care of that

                    again. i would suggest you change your action as mentioned, get rid of the ‘new order class’ etc and use the parameter available
                    (and perhaps brush up on how wordpress action/filter priorities and parameters work )

                    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.
                                          Viewing 20 posts - 1,321 through 1,340 (of 4,453 total)