Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Country-State Selector


stevel

Recommended Posts

I couldn't find an error in the code for the admin/customers.php file I had installed on my site, so I replaced it using the one that came with the contrib and now the page works fine. Hopefully that will be that...

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Excellent, thanks! How about in catalog/checkout_shipping_address.php? I can't find the code to adjust for that page.

 

Many many thanks!

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Hi,

Thank you for the great contribution.

I just have a small problem. I'm using the PayPal web paymnet pro for payment method, and the problem is that this contribution is sending Full State name to PayPal.

My question is, how can I change the State name to be viewed and sent in abbriviated form (TX instead of Texas)?

 

Thank you for your support.

Regards,

Link to comment
Share on other sites

Well, actually, this contribution doesn't change that, as far as I know. The PayPal contrib should be finding the "zone_code" and sending that rather than the state name, which even without this contrib, could have been entered in full by the customer. The zone_id is available in the order during processing of it - (the default osC does not save the zone ID to the database for the order.)

Link to comment
Share on other sites

Well, actually, this contribution doesn't change that, as far as I know.  The PayPal contrib should be finding the "zone_code" and sending that rather than the state name, which even without this contrib, could have been entered in full by the customer.  The zone_id is available in the order during processing of it - (the default osC does not save the zone ID to the database for the order.)

correct. i have a test cart running this and webpayments pro together. i have 80+ state entries for New York. New york customers see

New York (Ontario- Geneva)

New York (Sullivan)

New York (Wayne)

etc to add for a state.

 

no matter what zone they add it shows up as that zone in the address book. BUT for the orders they make the shipping and billing addresses are all just NY.

 

open your osc admin.

see if you have set the state to false under

CONFIGURATION/ CUSTOMER DETAILS/ STATE

mine is true <--test that first-- set it to true.

then if that fails:

look in your LOCATIONS/TAXES area. under ZONES

scroll to the United States Texas zone. look at the code entered there it should be just TX

 

all 80+ of my New York (Blah Blah County) codes are set to NY for the code part, and it seems that this is the "thing" (the 2 letter code) that gets set as the shipping/billing state. (paypal needs them to be all capital. not Tx, not tx, not TEXAS but TX...

make sure all your US states have a 2 letter code in caps.

there was a support thread for this paypal contrib that mentioned this with other people and a fix. but it has been banned and deleted without explanation.

Link to comment
Share on other sites

Hi Steve

 

Will you be releasing instructions on how to useyour super script to work in the affiliate module?

 

if you have no plans then please advise me on what the best way would be to integrate this for the affiliate mod.

 

so that the affiliates create account pages and admin/affiliate pages can have the same dropbox options

 

Thanks

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Well, nobody had asked me to do that, and I don't want to get in the general business of merging CSS with dozens of contribs. It's really not hard to add the functionality by some judicious cut-and-paste. The general concepts are:

 

1. Add the refresh_form JavaScript function

2. Modify the form so that it presents the zone list if present and adds the onChange action to the country list (this can be copied from create_account).

3. Modify the form processing code to recognize a "refresh" action so that it skips error checking and reconstructs the form values from the POST values.

 

Pay attention to the names of variables and form fields, which vary from page to page.

 

Oh, and for those using templates, you pretty much just separate out the form processing code from the form code itself - the processing code goes in the "normal" file and the form code goes in the template module. Do take care to update the correct form_check.js.php file, as the template contribs often have their own copy of this.

Edited by stevel
Link to comment
Share on other sites

Well, nobody had asked me to do that, and I don't want to get in the general business of merging CSS with dozens of contribs.  It's really not hard to add the functionality by some judicious cut-and-paste.  The general concepts are:

 

1. Add the refresh_form JavaScript function

2. Modify the form so that it presents the zone list if present and adds the onChange action to the country list (this can be copied from create_account).

3. Modify the form processing code to recognize a "refresh" action so that it skips error checking and reconstructs the form values from the POST values.

 

Pay attention to the names of variables and form fields, which vary from page to page.

 

Oh, and for those using templates, you pretty much just separate out the form processing code from the form code itself - the processing code goes in the "normal" file and the form code goes in the template module.  Do take care to update the correct form_check.js.php file, as the template contribs often have their own copy of this.

okee dokee

 

i've noted what you've said and i will give it a go and will let you know if i have success

 

thanks (as always)

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

correct. i have a test cart running this and webpayments pro together. i have 80+ state entries for New York. New york customers see

New York (Ontario- Geneva)

New York (Sullivan)

New York (Wayne)

etc to add for a state.

 

no matter what zone they add it shows up as that zone in the address book. BUT for the orders they make the shipping and billing addresses are all just NY.

 

open your osc admin.

see if you have set the state to false under

CONFIGURATION/ CUSTOMER DETAILS/ STATE

mine is true <--test that first-- set it to true.

then if that fails:

look in your LOCATIONS/TAXES area. under ZONES

scroll to the United States Texas zone. look at the code entered there it should be just TX

 

all 80+ of my New York (Blah Blah County) codes are set to NY for the code part, and it seems that this is the "thing" (the 2 letter code) that gets set as the shipping/billing state. (paypal needs them to be all capital. not Tx, not tx, not TEXAS but TX...

make sure all your US states have a 2 letter code in caps.

there was a support thread for this paypal contrib that mentioned this with other people and a fix. but it has been banned and deleted without explanation.

Hi ArtRat,

Thanks for your reply,

I checked all that you have mentioned above, I do have all the states in two capital letters.

Here is the deal, the PayPal WPP send the state name according to the billing/shipping address of the customer on his/her account. Since the state name is showing as full name, it is sending the information as a full name. Do you have any suggestion on how to change the state name, so it just shows the state code instead of stead_name?

Thank you for your time and help.

Regards,

Link to comment
Share on other sites

Hi ArtRat,

Thanks for your reply,

I checked all that you have mentioned above, I do have all the states in two capital letters.

Here is the deal, the PayPal WPP send the state name according to the billing/shipping address of the customer on his/her account. Since the state name is showing as full name, it is sending the information as a full name. Do you have any suggestion on how to change the state name, so it just shows the state code instead of stead_name?

Thank you for your time and help.

this is the wrong thread to address this question. find one of the soon to be deleted paypal pro threads (or start a new one) posting the question there. i do not know how it grabs the NY from my code. it just does. my state field could read: New York (Yates)

but just NY is in the shipping billing area and that is what is passed.

Link to comment
Share on other sites

this is the wrong thread to address this question. find one of the soon to be deleted paypal pro threads (or start a new one) posting  the question there. i do not know how it grabs the NY from my code. it just does. my state field could read: New York (Yates)

but just NY is in the shipping billing area and that is what is passed.

OK

Thanks

Regards,

Link to comment
Share on other sites

ive just noticed a problem, and this contribution comes to mind as the most likely(not saying it IS) cause of it.....

 

During a test checkout my card wouldnt process. I noticed that the primary address on my account was one that I had simply made up at some point. I changed it to match the creditcard I was using and it processed fine. I did this by clicking the "change address" button on the billing info page and checked a box next to my correct address which was already entered into the address book but not set as the primary. Later when I opened the invoice I noticed that both the billing and shipping addresses were still the original address, not the correct one that I had changed it to during checkout. I then went into my address book in osc and set the correct address as the primary. Even after it had it set as the primary(said primary address beside it) I could go back into checkout and it would STILL have the old primary address displayed for both billing and shipping info. I had to delete the original entry from the address book before it would properly display the new primary address during checkout.

 

Sound like it could be related to this contrib? Any ideas? Thanks for any help :thumbsup:

Link to comment
Share on other sites

Nope. This contrib does not affect how the information is stored. Note that osC stores a copy of your address information for customer, billing and shipping in the order record and does not tie them to your current address book. It's possible that this info was stored and not updated when you changed the address, though I'm not sure how that would happen.

Link to comment
Share on other sites

is there instructions somewhere to manually update the changes made just for V1.3.1?

 

Im running 1.2.1 and dont need the PWA stuff, and have modified this contrib to work with a couple others so I dont care to copy over my current files that seem to be working.

 

Is this "onload code that does a setfocus on the state field" a big deal? Ive never gotten any javascript errors.....but wouldnt mind correcting it if its possible that my customers are seeing it. How big of an issue is it, and what lines need fixed to correct the issue? Thanks :thumbsup:

Link to comment
Share on other sites

The onload change is described in the readme, which is simply to restore the <body> tag to its original state. It doesn't sound as if there's anything ele you need to be concerned about.

Link to comment
Share on other sites

  • 3 weeks later...

Fantastic! The perfect thing (works great with State Based Region Shipping Rates)

 

However, I get the following error when I go into the admin / customers:

 

Parse error: parse error in /var/www/funaticalcomau/public_html/shop/admin/customers.php on line 235

 

I expect it's something to do with the Qty Price Break Per Customer contibution I;ve also got installed - but I don't have the skill to figure out what the %$ is going on!

 

starting from line 224... this is my code

		} 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'] . "'");
	  }

 

Can anyone help?

 

Cheers,

Tim

Link to comment
Share on other sites

Parse error: parse error, unexpected T_CASE in /home/username/public_html/shop2/admin/customers.php on line 198

 

and line 198 is this:

 

case 'deleteconfirm':

 

can anyone advise please?

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

You can't just go by the line number or an excerpt of the file. In the version in C-S Selector, that line is 188. I'd guess that there's an extra } somewhere prior in your versions.

Link to comment
Share on other sites

You can't just go by the line number or an excerpt of the file. In the version in C-S Selector, that line is 188. I'd guess that there's an extra } somewhere prior in your versions.

sorted - i installed admin notes before hand and couldn't get this to work so i got the customers.php file from the download and added the admin notes to that instead

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Steve

 

After seeing the Active Countries script from enigma1 - i kind of appreciate how important it would be have a script allowing the 'enabling' and 'disabling' of countries.

 

I know this can be done by deleting them one by one via SQL but what happens if you want to re-add them?

 

How difficult would it be to add that facility within the country-state script? If you don't have the time to do it or it doesn't warrant highly on your list of priorities, then please advise on how it should be done

 

many thanks as always

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

The way I would approach it is add a "Enabled" field to the Countries table, add support in Admin for the selection, and then change the query in tep_get_country_list to request only the enabled countries. None of the Country-State Selector code would be involved.

 

Is there no contribution which does this already?

Edited by stevel
Link to comment
Share on other sites

  • 4 weeks later...

any Idea what the follow error means when I go to Admin/locations/taxes countries

 

1054 - Unknown column 'countries_status' in 'field list'

 

select countries_id, countries_name, countries_status, countries_iso_code_2, countries_iso_code_3, address_format_id from countries order by countries_name limit 0, 20

 

[TEP STOP]

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...