Use ZipCode Plugin but avoid Popup

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #16766
    Thomas Ulbricht
    Participant

      Hello Olli,

      one question: is it possible, if I submit some variables via url to avoid the popup-layer to be asked again for the zip code.

      Background: I have a page before entering a shop, where people choose their zip code and then I redirect them to the shop page which “is responsible to handle there customers”. and if i can submit the “used zip code” via url/variables i can avoid that they have to re-choose the zip code – because THAT would “look like a mistake”.

      But i don#t won’t to avoid the popup layer in general, because customers who come directly to the shop SHOULD be asked!

      I hope you know what i mean 🙂 Thanks a lot and greetings,
      thomas

      #16768
      Olly
      Admin & Mod

        the selected value is stored in a global session variable. it will only popup again if you are actually redirecting to a different server/domain altogether (or clear the session of course).

        you would have to figure out a way to share sessions across domains (memcached springs to mind perhaps – just off the top of my head – which might or might not help you)

        #17071
        Thomas Ulbricht
        Participant

          I have a really big problem with it and maybe you can help.

          1. I have a multisite installation with various restaurants
          Structure is https://www.url.com/restaurant1
          https://www.url.com/restaurant2
          https://www.url.com/restaurant3
          and so on.

          2. I have a page that is just for the user to select the post/zipcode …
          that is the main page of my multisite installation

          3. On this main page i have entered all the zip codes for the various restaurants with a redirect to the restaurant. that works fine … user selects post/zip code and gets redirected. post/zip code is correctly used

          4. on the restaurant page itself i have entered all the zipcodes with minimum order etc … again. (If a user doesn’t come via the main page. If he comes directly to the restaurant page he should select too…)

          PROBLEM now: If a user comes directly to the restaurant page everything works fine. If a User comes via the “Main page” and selesct his zipcode he is redirected to the right site, the zip/postcode is correctly used BUT the
          – delivery charges and
          -minimum order

          is ignored.

          So in short:
          Directly to page : everything is ok
          User comes via “Main page” and get redirected: No Delivery Charges and no Minimum order. (The values from the restaurants oder settings are used …)

          Any idea what to do??

          P.S. I hoipe you understand what I mean … SOrry for the maybe very bad explanation 🙁 But it is hard to find the right words for the (for me) complex situation….

          THX !!!

          #17076
          Olly
          Admin & Mod

            i’m only guessing, but did you set up the plugin for ALL (sub)sites too ?

            sorry, didnt read your post properly, it seems you did.
            i’ll try to reproduce this sort of setup here first before commenting further

            #17077
            Olly
            Admin & Mod

              btw:
              please start new questions by starting a new topic (even if they are vaguely related) to keep things somewhat better organised and searchable

              #17095
              Thomas Ulbricht
              Participant

                Hello Olly …

                a. Stating a new topic: Ok… should we continue here or should I open a new one now and repeat the issue ?

                b. I noticed something – maybe it helps. If a user comes fomr the “main page” to a restaurant page and the minimum order/delivery charges are ignored … when i go to the order page and then change the zipcode/location from the dropdown … THEN the system realises that there is “data” and aplies it ….

                #17245
                Olly
                Admin & Mod

                  at the moment i think you are the only user that actually uses the redirection option to start off with.
                  i somewhat agree that it perhaps should not only redirect but perhaps also use that setting/selection in the site the plugin will redirect too. This is not the case at the moment and it just redirects and nothing else.

                  Let me see what can do. I’ll have to see what other issues doing this may cause though

                  #17246
                  Olly
                  Admin & Mod

                    it depends on a multitude of things, but the following should certainly help, so please try this :

                    a) make a backup of your site / db (also turn on debug like so please as it might come in useful : https://www.wp-pizza.com/topic/how-to-enable-debug-in-wordpress/)

                    b) if at all possible i would also strongly suggest you do this on a demo/staging site instead of a live/production site first

                    c) open wppizza-delivery-by-postcode.php and edit as follows

                    on approx line 117 change

                    
                    if ( is_user_logged_in() && $_SESSION[$this->dbpSession]['dbp']==''){
                    

                    to

                    
                    if ( is_user_logged_in() && $_SESSION[$this->dbpSession]['dbp']===''){
                    

                    on approx line 125 change

                    
                    $userMetaDbpKey=!empty($validAreas[$userMetaDbpLbl]) ? $validAreas[$userMetaDbpLbl] : '' ;
                    

                    to

                    
                    $userMetaDbpKey=(isset($validAreas[$userMetaDbpLbl]) && $validAreas[$userMetaDbpLbl]>=0) ? $validAreas[$userMetaDbpLbl] : '' ;
                    

                    d) go to an wp admin : wppizza->post/zipcode “deliver options” page and save (this will clear the session so you are not looking at old data)

                    e) let me know if this is better/the same / worse.

                    there might well be a couple of other bits that need adjusting/changing (coding or set-up wise), but one step at a time

                    #17251
                    Olly
                    Admin & Mod

                      sorry i forgot , there’s one more thing to change (same file)
                      approx line 156 change

                      
                      if($_SESSION[$this->dbpSession]['dbp']=='') {
                      

                      to

                      
                      if($_SESSION[$this->dbpSession]['dbp']==='') {
                      
                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • The topic ‘Use ZipCode Plugin but avoid Popup’ is closed to new replies.