Cannot set free delivery for some

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #15969
    Pascal
    Participant

      Hi,

      I intend to use this extension a little bit different with City names instead of zipcodes. Not that this should matter.

      I have the following setup now:

      – Standard delivery costs 3,- in the regular wp pizza settings
      – Delivery costs for some cities 3, 2 or 2,50 in the zip extension

      But I want to set the delivery costs for 1 delivery area to 0. But a 0 is not allowed and it defaults to 3,-

      But what I really would like to setup is:

      – Default delivery costs 3,- and free with a minimum order of 8,-
      – Set delivery costs for some cities to 3, 2,50 or 2,- and a minimum order of 10, so no free delivery ever.
      – Set delivery costs for 1 area to free if minimum order is above 10,- and otherwise set the delivery costs to 1,- (so order 8 or 9 euros pay 1 euro delivery costs anything above 10 it’s free).

      But I cannot set this up either. If I do not enter a value at free delivery in the zip extension it will still be free if the order is above 8 euros.

      The first problem can be solved by setting the delivery costs to 0,01. But that’s not a nice solution as 1 cent is not free delivery. The second problem I have not found a solution for yet.

      Please advise 🙂

      #15970
      Olly
      Admin & Mod

        >But a 0 is not allowed…
        you sure ? i can set 0 just fine here.
        can you do a screenshot of the “Delivery Charges:” in wppizza->order settings
        and a screenshot of the post/zip delivery options please , so i can first of all try to reproduce this?

        thanks

        #15971
        Pascal
        Participant

          Okay technically it allows a 0, but after saving it removes the 0 and is empty.

          General settings where delivery charge is set to 3,-

          General settings delivery charge

          The 0 I entered at Roermond disappeared and only works if I set it to 0,01:

          Delivery costs setup

          #15976
          Olly
          Admin & Mod

            looks more like a max_post_vars/max_input_vars issue..
            are you running suhosin or have limited max_post_vars/max_input_vars somehow ?

            #15987
            Pascal
            Participant

              Hi,

              If that was the problem I should not be able to set the same var to 0,01 or another value?

              max_input_vars is set to 1000

              suhosin.post.max_vars is set to 20000

              Tested with PHP 5.5, 5.6 and 7 and all give the same result

              #15988
              Olly
              Admin & Mod

                >If that was the problem I should not be able to set ….

                probably, but if – for some reason – some other vars change and you might therefore run out of max vars, it could have been an issue. Alas at 1000 post vars, you should be just fine here. so the problem is elsewhere.

                as i said, i can save 0 just fine here.
                can you turn on debug please and see if you get any info from there ?

                #16007
                Pascal
                Participant

                  Hrmz. The wordpress debug is on. But no errors there.

                  Strange thing is that I can set the minimum order to 0, but when I put a 0 in the delivery charge it is emptied on save.

                  It seems to go wrong when saving to the database.

                  In the options table it says: s:6:”charge”;i:0;s:17: while other places have a d:<value> instead of i:0

                  #16008
                  Olly
                  Admin & Mod

                    let me check a few things here, i believe i may have been looking at the wrong input field

                    #16009
                    Olly
                    Admin & Mod

                      so, now i am looking at the right input field (doh, sorry) it seems like it’s in fact correctly saving to the db, but not displayed when set to 0 in the admin .

                      i’ll fix that in an update.

                      for now, please do the following:
                      in admin.echo.get_delivery_areas.inc.php on apprx line 50 you will find

                      
                      $value=!empty($options[$field][$k]['charge']) ? wppizza_output_format_price($options[$field][$k]['charge'],$optionsDecimals) : '';
                      

                      REPLACE this with

                      
                      $value=isset($options[$field][$k]['charge']) ? wppizza_output_format_price($options[$field][$k]['charge'],$optionsDecimals) : '';
                      

                      (i.e the !empty becomes isset )

                      once you have done that, let me know if that fixes things…

                      #16020
                      Pascal
                      Participant

                        Thanks that works for the backend indeed.

                        However if I select the delivery area Roermond on the frontend the order costs are the default 3,- instead of 0,-

                        For the other delivery areas it works fine.

                        #16021
                        Olly
                        Admin & Mod

                          ok
                          i did not actually test that over the weekend.
                          i’ll look at it . assuming you are right, i am somewhat surprised though that nobody has noticed that before ….

                          anyway , will get back to you in a bit

                          #16025
                          Olly
                          Admin & Mod

                            ok, should be fixed as of 3.9.2 which should show up in your admin ->plugins in a bit as an update (assuming you have activated the licence)

                          Viewing 12 posts - 1 through 12 (of 12 total)
                          • The topic ‘Cannot set free delivery for some’ is closed to new replies.