WPPizza – A Restaurant Plugin for WordPress › Support › Add-Ons › Extensions › Delivery By Post/Zipcode › Support › Use ZipCode Plugin but avoid Popup
- AuthorPosts
- 22 March, 2016 at 2:06 pm #16766
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,
thomas22 March, 2016 at 2:27 pm #16768the 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)
4 April, 2016 at 4:12 pm #17071I 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 installation3. 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 orderis 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 !!!
4 April, 2016 at 8:00 pm #17076i’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 further4 April, 2016 at 8:33 pm #17077btw:
please start new questions by starting a new topic (even if they are vaguely related) to keep things somewhat better organised and searchable4 April, 2016 at 11:48 pm #17095Hello 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 ….
8 April, 2016 at 4:36 pm #17245at 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
8 April, 2016 at 6:08 pm #17246it 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
8 April, 2016 at 6:31 pm #17251sorry i forgot , there’s one more thing to change (same file)
approx line 156 changeif($_SESSION[$this->dbpSession]['dbp']=='') {
to
if($_SESSION[$this->dbpSession]['dbp']==='') {
- AuthorPosts
- The topic ‘Use ZipCode Plugin but avoid Popup’ is closed to new replies.