Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Country-State Selector


stevel

Recommended Posts

okay I checked the java console

No errors

Several warnings (none on create_account.php)

A couple of messages about a security warning pages may not connect to../..../..../...green_bg.gif

 

here is the site if you have a few moments to check www.feather-aid.com

just go to create an account.

Link to comment
Share on other sites

okay after reading a few more posts I *believe* I have the solution. The page DOES refresh when country is changed. Just not state. I looked at the code and I can't find an onChange command for state. If it's something else, I'll post that here. Thanks again. Great job, btw...it's rare to see someone so dedicated to their mods.

Link to comment
Share on other sites

It's not supposed to refresh when you change the state - only the country. For state, you have a dropdown list (if zones are defined for that country) that the customer selects from.

 

What purpose would you envision being served by refreshing on a state change?

Link to comment
Share on other sites

I have the subzone tax mod installed as well. So if you select Colorado, it's supposed to refresh and bring up the options for County.

 

It's actually kind of strange because before I made the changes I just made, it was working just fine...I'm double checking the changes for the subzone mod to see if it's in there, but so far, I haven't seen that I've reversed anything.

Edited by tskinner
Link to comment
Share on other sites

OKay I must have had something wrong with the original input of your mod, and then changing everything to the way your files were set up, and then completing the subzone tax instructions again has completely fixed every error I was having.

Thanks again for reminding me to make sure I wasn't just a bonehead. lol :)

Link to comment
Share on other sites

Sorry if this has been addressed before, but my searching hadn't turned up the problem discussed here, so here goes:

 

I have been running with this GREAT mod for some time now and it has worked fine - except occasionally, some people have reported that they haven't been able to select the state they want (it's usually PA, but in the past it has been MA), either via the address book or during account creation. Some people don't tell me about the problem when they encounter it, but when I get their order, it shows up as "*Please Select a State*" which is what I have as my default.

 

I have been unable to reproduce this problem at my end - the state selector works great for me and 99% of my customers, but I see it often enough that I am afraid most people will not place an order if they can't input their address correctly. I browsed the database, but didn't see anything blatantly wrong. Perhaps re-indexing a table would help? If so, I have no clue as to how to do that - I didn't see anything in MySQL that had that as an option.

 

Thanks again for an otherwise wonderful contrib!

Michael

CheesyFlix.com

Link to comment
Share on other sites

Never heard of that one before. It could be a corruption of the "zones" table. Try running a check on that in phpMyAdmin (or whatever you use).

Link to comment
Share on other sites

Never heard of that one before. It could be a corruption of the "zones" table. Try running a check on that in phpMyAdmin (or whatever you use).

 

That's what I was thinking, since it seemed to be state-specific, and only with a few states. I use phpMyAdmin, but don't know what I would do to check the table integrity. I realize you aren't an SQL tutorial, but any quick help on how to "run a check" on the "zones" table would be most appreciated! :-)

Link to comment
Share on other sites

Click on the "zones" table. Click on the Operations tab. Under Table Maintenance, click Check. If it shows an error, you can click Repair under the same section.

 

I'm working on an update to the contrib which will require a state to be chosen. On one of my stores, I was getting customers leaving the state as Alabama. At first I thought there was a coding error but I then convinced myself that the users were just not changing the state from the default.

Link to comment
Share on other sites

Click on the "zones" table. Click on the Operations tab. Under Table Maintenance, click Check. If it shows an error, you can click Repair under the same section.

 

I'm working on an update to the contrib which will require a state to be chosen. On one of my stores, I was getting customers leaving the state as Alabama. At first I thought there was a coding error but I then convinced myself that the users were just not changing the state from the default.

Thanks, I'll give that a try in a minute and let you know if errors were encountered.

 

Yeah, I too was getting a LOT of Alabama orders when I first installed your contrib - LOL! Which is why I added a "State" called "*Please Select a State*" to the table. The asterix forced it to the top of the list and also drew attention to the fact that something besides "Alabama" was to be chosen.

 

I knew there weren't THAT many customers from the deep south with a zip code starting with a "9" - LOL

Link to comment
Share on other sites

Well, I've run checks on that table and a dozen others, but they all report as "OK" so I'm not sure where else to turn for this problem. I also ran a "repair" on it with the same result.

 

Let me know if you can think of anything else. I did change the other table a while back to only show abbreviated state names, but again, it doesn't explain why most people don't run into problems. Weird that the states affected were PA and MA - I though it must be the letter "A" in the second position that causes this, but CA hasn't had a problem that I know of. Of course, they do everything different in CA - LOL.

 

Thanks again,

Michael

CheesyFlix.com

Link to comment
Share on other sites

I think I must be having a problem that is not suppose to be happening.

 

To begin with, let me say that I just installed OSC yesterday and have no other contributions installed. I modified all of the files for Country-State Selector v 1.3.3.

 

From the user perspective, everything seems to be fine. From the admin perspective, I have problems. Whenever I try to go to the Customers section of admin, I get the error pertaining to customers.php. I know that on the page for the contribution, it says:

 

catalog/admin/customers.php

Line 196:

 

Replace:

$processed = true;

}

 

with:

 

$processed = true;

// +Country-State Selector

} else if ($refresh == 'true') {

$cInfo = new objectInfo($HTTP_POST_VARS);

}

// -Country-State Selector

 

However, this can't be the right fix. I say so because I had already done this - it's part of the basic instructions for version 1.3.3. So that isn't fixing the problem. The error I receive (Parse error: syntax error, unexpected T_CASE ) references line 193, which comes just after the portion in the quote. Line 193 reads:

 

case 'deleteconfirm':

 

I really like the drop down menu that this creates for the States, and would like to have this contribution, plus I am lazy and dont want to take the time to undo all of those changes. Is there something I can do to get this thing working?

 

Here is a block of code from that section of my customers.php:

 

		tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");

	tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id));

	} else if ($error == true) {
	  $cInfo = new objectInfo($HTTP_POST_VARS);
	  $processed = true;
	  // +Country-State Selector
	  } else if ($refresh == 'true') {
		$cInfo = new objectInfo($HTTP_POST_VARS);
	  }
	  // -Country-State Selector
	}

	break;
  case 'deleteconfirm':
	$customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);

	if (isset($HTTP_POST_VARS['delete_reviews']) && ($HTTP_POST_VARS['delete_reviews'] == 'on')) {
	  $reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");
	  while ($reviews = tep_db_fetch_array($reviews_query)) {
		tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews['reviews_id'] . "'");
	  }

	  tep_db_query("delete from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");
	} else {
	  tep_db_query("update " . TABLE_REVIEWS . " set customers_id = null where customers_id = '" . (int)$customers_id . "'");
	}

Edited by BullionFever
Link to comment
Share on other sites

Using a file comparison tool, compare your customers.php against the pre-edited one and look to see what is different. Or, as an experiment, swap in the pre-edited one and see if it works.

Link to comment
Share on other sites

Hi, i'm having the same problem as Bunhila, the user who cant enter the admin login in his shop, it gives me an error in the line 115

Fatal error: Call to undefined function: tep_hide_session_id() in /usr/home/calculadorasgraficas/www/tienda/admin/login.php on line 115

if i erase that line i can enter the admin login but it give me lot of errors in catalog, customers.php, and a few more. You can see what im talking at http://calculadorasgraficas.com/tienda/create_account.php and http://calculadorasgraficas.com/tienda/admin/login.php

Thanks for your help and your time

Edited by valenior
Link to comment
Share on other sites

When I last updated this contribution, there was no such feature as admin login. My guess is that you simply replaced one of the admin files with a pre-edited file from the contrib rather than merging the edits.

 

I will update the contrib to reflect the RC1 revision, but it will take me a while. In the meantime, all you should need to do is take the additional functions added to admin/includes/html_output.php and ADD them to the one from your osC distribution.

Link to comment
Share on other sites

  • 4 weeks later...

Hi i'm Italian, i've installed the Coutry-State Selector for 2 times but i've a problem: i use two language on my Osc, italian and englsih and the script of contrib work only for the english side. I have another problem with this contrib: start with add the information in the various fields and when i set the menu of country all of the form is reset (clear). How can i do?

Thank's in advance and excuse me for my bad english :rolleyes:

 

Bye

jedinight

Link to comment
Share on other sites

The usual problem is that you put HTML tags with double-quotes in the non-English language file defines for ENTRY_xxx. You can't do that as these are used in JavaScript. This may also cause other problems.

Link to comment
Share on other sites

I will update the contrib to reflect the RC1 revision, but it will take me a while. In the meantime, all you should need to do is take the additional functions added to admin/includes/html_output.php and ADD them to the one from your osC distribution.

I have been using this contrib for a while now and is good. Thanks for all your hard work on this.

One problem I've run into is if you do not have the state the customer needs to put in, then they can not create an account. I had a customer from Belfast try to create an account but I did not have any of the Northern Ireland states.

Is it possible that you could add an extra states box to use if the state does not appear in the drop down? I think that could be usefull.

Thanks for time and work Brian

Link to comment
Share on other sites

not create an account. I had a customer from Belfast try to create an account but I did not have any of the Northern Ireland states.

Is it possible that you could add an extra states box to use if the state does not appear in the drop down? I think that could be useful.

It would be better if you made sure, if you added zones for a country, that you added ALL the zones. Don't rely on "world zones" contributions for this - my past experience has been that they are inaccurate and incomplete. I use the Universal Postal Union web site for this information with links to member country postal web sites.

 

For Northern Ireland, it follows Great Britain/UK rules and the "county" is optional if you have a town and postcode. For UK, I choose to not define zones.

 

If you wanted to do this, in the case where there are zones you'd display an extra text input field called, say, statex. At the top of the PHP file, where it is looking to see if it has a state, it would first look for 'state', then 'statex' and then the zone ID.

Link to comment
Share on other sites

If you wanted to do this, in the case where there are zones you'd display an extra text input field called, say, statex. At the top of the PHP file, where it is looking to see if it has a state, it would first look for 'state', then 'statex' and then the zone ID.

Thanks for your reply. I did use the worldzones when I first started. I'm nothing more than a novice at best so I would be concerned with changing any id codes in the db and messing up the customers.

I have been trying to add an extra input box to check against the states drop downlist. I got the create_account.php page, but was starting to run into trouble on the other pages. I'll keep plugging away at it though.

Again thanks very much Brian

Link to comment
Share on other sites

  • 3 weeks later...

Hi

 

I am using a template system, but I am seeng the refresh in the source code - but is not refreshing...where is the form check in sts template ?? Any other ideas why this wont refresh??

 

thanks

 

R

Rusty

-------------------------------------------

Link to comment
Share on other sites

Typically the template systems have a separate copy of the sources - you'll have to find the right one to modify. I don't use templates so I can't give you specific advice.

Link to comment
Share on other sites

Great Contribution,

 

I have 1 question, I want to have United States Automatically selected, how can this be done?

 

Right now it has please select, I thought it would do this automatically since United States is Default, did I miss something here?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...