Page 1 of 1

anyone know how...

Posted: Wed May 10, 2006 7:35 pm
by BD
If you go to http://www.wine.com a you get prompted for a state, which saves for later use.

Anyone know an easy (i.e. canned) way of doing this? Their code is giving me a headache.

Thanks

Posted: Wed May 10, 2006 7:52 pm
by Baron[CotC]
Isn't it just saving a cookie?

Posted: Wed May 10, 2006 9:48 pm
by D.A.R.K.[CotC]
That little popup disables the whole website until you select a state... seems like more than just a simple cookie that's involved....

and yeah, the code really is a headache... only the person who wrote it would understand it...

Posted: Wed May 10, 2006 10:07 pm
by BD
ya, but it's also unhiding the div and storing it on the webpage... i used to kow this stuff

Posted: Wed May 10, 2006 10:12 pm
by D.A.R.K.[CotC]
I probably won't go into web designing for my future career....

Posted: Wed May 10, 2006 10:20 pm
by BD
yeah, I either have to learn me some e-commerce or dump this client... heh

Posted: Thu May 11, 2006 8:52 pm
by Baron[CotC]
well the state is most likely stored as a cookie. I haven't looked at his code, you'll probably find he's running server-side scripts we cant see anyway.

As for teh popup blocking the rest of the site until you select a state...

-- Check for a cookie if one doesnt exist then we need to make a popup
-- create an invisible popup that covers the entire website and prevents clicking through it
-- create a pick-a-state popup as the top layer that takes the user's choice and saves it as a cookie
-- then refresh the page and start at the check for cookie step again

-- if a cookie exists skip all the neat code and just go about normal business