Jump to content
stevel

Country-State Selector

Recommended Posts

Laurelle, see here.

 

Edit, ah, that seems to be from an older version. Let me work out how it's done now.

 

Thank you for your help. That post was very close to what is needed now.

 

The code that you use to default the state is:

		  echo tep_draw_pull_down_menu('zone_id', $zones_array, '67');

 

You would change the '67' to the value of the state you want to be the default state. You can find what that value is by looking at the source code of the page where the pulldown menu is and see what value is used for the state that you want as the default.

 

Hope this helps others.

Share this post


Link to post
Share on other sites

Howdy, if this has been answered elsewhere please someone point me to the right location. Thanks .....

 

I am attempting to merge this contribution in with the 'fast easy checkout' contribution that I already had installed. Since the 'create account' page has been heavily hacked I am trying to work through the changes just on my own.

 

The page will render ok, and when it does the default country is correctly selected as 'united states'. However, the states drop down box lists every possible state and not just the states in the US. The database query looks ok and $country seems to be defined right.

 

Any suggestions on how to move froward?

Share this post


Link to post
Share on other sites
Howdy, if this has been answered elsewhere please someone point me to the right location. Thanks .....

 

I am attempting to merge this contribution in with the 'fast easy checkout' contribution that I already had installed. Since the 'create account' page has been heavily hacked I am trying to work through the changes just on my own.

 

The page will render ok, and when it does the default country is correctly selected as 'united states'. However, the states drop down box lists every possible state and not just the states in the US. The database query looks ok and $country seems to be defined right.

 

Any suggestions on how to move froward?

Scratch that ..... I found the answer back a few pages in this thread

Share this post


Link to post
Share on other sites

I just installed this mod here https://www.alcohol-injection.com/account/create.html

but my page does not reload when you change the country. I have to hit enter for it to change the state box. Any help would be apreciated.

 

IN java console i get refresh_form not definded

Edited by rocket468

Share this post


Link to post
Share on other sites

I put the java that suposta go in forum_check.js in my body.js and it fixed it. I guess my site does not use the forum_check.js

Share this post


Link to post
Share on other sites
Thank you for your help. That post was very close to what is needed now.

 

The code that you use to default the state is:

		  echo tep_draw_pull_down_menu('zone_id', $zones_array, '67');

 

You would change the '67' to the value of the state you want to be the default state. You can find what that value is by looking at the source code of the page where the pulldown menu is and see what value is used for the state that you want as the default.

 

Hope this helps others.

 

is there anyway to default it to something that forces the user to change it like select state and add a form check to make sure they select one. It's amazing how many idiots will just leave it at Alabama and expect to get their products.

Share this post


Link to post
Share on other sites

Problem with pull down for state/province.

Downloaded the latest version of the contrib.

Manually changed the files.

catalog/admin files presented a problem (different files than those which were altered)

Reinstalled original files.

Same problem with pull down for state/province.

Copied files from contrib and now the same problem (can't choose a state/province) exists as well as there's a fatal error in trying to sign into admin.

 

Call to undefined function: tep_hide_session_id() in /home/esrac/public_html/catalog/admin/file_manager.php on line 135

 

Customers are turning away.

 

Thanks for any help.

Donna

Share this post


Link to post
Share on other sites

I have been trying to get a combination of Country-State Selector/Purchase Without Account/Fast Easy Checkout to work together, but have run into all sorts of minor problems. I backed up to my previous version of the store (2.2ms2-060817) and have re-installed just C-SS. But I have an issue with that: if I use the AutoFill on my browser (Firefox), the country dropdown is selected (Japan) but not the state (remains at the default). The only way around it is to select a different country, refresh, then select the correct country manually. The only other major contribution installed is STS (v4.5.8).

 

Is there any way to either 1) have the state dropdown also work with AutoFill or 2) have neither the country not the state work with AutoFill so that they are done manually by default?

 

You can see this here: Japan Store (Create Account page)

 

I'd like to get this problem fixed before moving onto trying to get PWA and FEC to play nice, too.

Edited by tokyoguy

Share this post


Link to post
Share on other sites

hi. don't know if anyone had this similar problem before, but I installed this contribution just copying the files to my catalog folder. everything seems to work fine in catalog (refreshing the page and everything), but the login/password fields disappeared from admin section, so I can't log in there. i'm using the last version of OSC with QTpro contribution only.

thank you.

Share this post


Link to post
Share on other sites

It's some other change you made. This contribution doesn't do anything with admin login (and there was no such thing in standard osC when this contribution was written.

Share this post


Link to post
Share on other sites

thank you for the really fast reply. when I upload the files, I can't login in admin. once I restore the original files, everything stays fine again. the only mods i'm using is QTPro and attributes sort fix (pad_base.php). with them installed everything is working well. but when I upload country-state selector, my login disappears. this mod is incompatible with these mods? i'm testing in a local apache server, with zero products (don't know if this makes any difference). i repeated the installation/restore backup files (incl. qtpro and sort fix) process many times, so I can assure the bug has something to do with country-state. the files inside admin folder are required? if I don't upload them, there's no bug, but your mod seems to work properly. thank you again, nice work with this mod.

Share this post


Link to post
Share on other sites

thanks steve.

I don't know whats happening also. I'm just using default files downloaded from oscommerce website (v2.2 RC1). really strange.

but anyway, i'm loving this mod, and the admin thing is not really a need for me. congrats and keep the good work. :)

Share this post


Link to post
Share on other sites

EDIT: I solved the problem. :) Just updated the original "html_output.php" manually (with your code provided inside readme.htm).

 

uploading files one by one I realized that the file that disappears with login form here is your edited "html_output.php".

sorry for take your time like this, but if you have any suggestion, I would appreciate.

Edited by baunilha

Share this post


Link to post
Share on other sites

Ah, I see. The pre-edited files I supply are based on a stock install of 2.2-MS2 as of December 2006. You have added functionality which evidently required some change to html_output.php. You would therefore need to merge the changes.

Share this post


Link to post
Share on other sites

Found a problem and need help on where to look . .

 

I have no refresh. I work on Mac and get nothing in latest safari and FF but have also tested in a PC with IE6 and still no refresh when I change to any other country, not even if I hit enter after changing country. nothing. If someone can help it would be great as I dont want to have to go back to the back up if possible and right now I can only accept customer from Malta as there is no text option available if from another country.

 

Thanks again, look forward to some guidance.


Tony

Share this post


Link to post
Share on other sites

Now there's a strange thing . . maybe there was a problem with an upload somewhere but I tested the sign up procedure again today and its working perfectly ! GREAT Contrib, it really makes it easier for my customers to get in and start shopping. thanks so much and the instructions are perfect. . . even for me to follow !


Tony

Share this post


Link to post
Share on other sites

Hi I recently installed this mod to my site and I'm finding problems now. It happens with create account. On Internet Explorer, when a state is selected other than the default, the pages refreshes, wiping the ENTIRE form clean. It even puts the state back to default. This makes it impossible to create an account on this web browser. On Firefox, When a state is selected, a popup comes up asking if i want password manager to remember this new password. Also, when the form refreshes, The minimum value errors appear at the top of the form (example; phone number must contain 10 characters). I'm guessing that the refresh doesn't just refresh the page, it submits and clears it. Here is the country-state selector refresh form function in my form_check.js.php file. Please help. The one browser is just a nuisance. The IE problem is major. btw, I have display errors on in IE and none come up.

 

<?php // +Country-State Selector ?>

function refresh_form(form_name) {

form_name.action.value = 'refresh';

form_name.submit();

return true;

}

<?php // -Country-State Selector ?>

Share this post


Link to post
Share on other sites

I suggest that you compare your edited files against the pre-edited ones supplied. Correctly installed, this contribution works fine in IE and Firefox (and Opera and Safari and ....)

Share this post


Link to post
Share on other sites
I suggest that you compare your edited files against the pre-edited ones supplied. Correctly installed, this contribution works fine in IE and Firefox (and Opera and Safari and ....)

 

Yeah that's what I was told. From the sound of it, it has to be something i've done or haven't done. I just wanted to find out exactly which file could be causing it. "Fresh eyes" kind of thing :) I've compiled 11 hours straight on this same problem Then again, it might even be SSL. I didn't create any test accounts in IE until after it was installed *shrugs* ....

 

Thanks for the tip. I'll take a look.

Share this post


Link to post
Share on other sites

The problem is that "eyes" need to see all your PHP for something like this. Using a file comparison tool such as Beyond Compare to diff your file against the pre-edited one often helps identify problems.

 

It doesn't sound like SSL to me - rather, the code that fills in the form based on POST elements is not being executed. Could be a missed edit, or a misplaced brace.

Share this post


Link to post
Share on other sites

Thank you for the tip. I just did that with Context. I went ahead and replaced everything I had different than the create_account file you provided in your mod with what you had. Even when I didn't see what the difference was. I no longer have that same problem. It just doesn't refresh. However, there were lots of posts here about not refreshing at all so that one shouldn't be a problem. Thank you for your time!!! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×