Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Removing Country Checkout Field | US only | State Drop Down

Removing Country Checkout Field | US only | State Drop Down

Views: 4,095

Results 1 to 14 of 14
16 Jul 2012, 5:04 AM
#1
jeff768 avatar

jeff768

New Zenner

Join Date:
Jan 2012
Posts:
25
Plugin Contributions:
0

Removing Country Checkout Field | US only | State Drop Down

how do i swap the default State/Province field for a drop down with the states all ready to go? I did the continental 48 only and it stopped the UPS module. and i ended up backup up from 2 days ago to get the shipping module working again.

currently i have the following settings:

config --> my store --> country : United States

config --> my store --> Zone : Empty

modules - United Parcel Service, UPS - it is on, but light is red. works okay now. NO SHIPPING zone is selected in UPS module.

countries - Canada, CA, CAN |United States, US, USA

zones - none.

zone definitions - florida

i'm really looking for the best way. a month ago i did the delete all countries except us and that threw errors, passing incomplete or non matching address info to paypal. so i guess, i'm looking for the best way over quick and dirty.

16 Jul 2012, 5:09 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Removing Country Checkout Field | US only | State Drop Down

jeff768:

how do i swap the default State/Province field for a drop down with the states all ready to go?
Admin->Configuration->Customer Details->State - Always display as pulldown? ---- set to true.

16 Jul 2012, 5:22 AM
#3
jeff768 avatar

jeff768

New Zenner

Join Date:
Jan 2012
Posts:
25
Plugin Contributions:
0

Re: Removing Country Checkout Field | US only | State Drop Down

Thanks for the quick reply. That did nothing. it's like it didn't even work. i double checked.

i need to get RID of THE COUNTRY FIELD all together and have the states in a pull down for both the checkout and the shipping estimator.

please note the settings above in the original posts. i do not have a us, or usa zone set.

bulkgummy.com/index.php?main_page=login

16 Jul 2012, 5:42 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Removing Country Checkout Field | US only | State Drop Down

Keep in mind the following meanings:
Zones = states/provinces associated with countries
Zone Definitions = defined combinations of Zones, which can be assigned for various purposes, such as taxation, shipping restrictions, payment-module restrictions, etc

jeff768:

Thanks for the quick reply. That did nothing. it's like it didn't even work. i double checked.As I quoted, that setting simply makes the state/province field become a pulldown.

And the pulldown's normal functionality is to show the states/provinces associated with the selected country.

jeff768:

i need to get RID of THE COUNTRY FIELD all together and have the states in a pull down for both the checkout and the shipping estimator.Well, without knowing the "why" behind how you arrived to making that statement, I would wholeheartedly disagree.

The only thing about the "why" that I can surmise from your post is that you've tried a whole bunch of things to set up some restrictions, for some unknown reason, and didn't arrive at your desired goal, again which isn't stated.

jeff768:

please note the settings above in the original posts. i do not have a us, or usa zone set.
I would suggest you set "My Store: Zone" to your store's state. That's important for several good reasons including shipping and payment and taxation purposes.
I would also suggest setting Admin->Configuration->Customer Details->Create Account Default Country ID to United States, since you appear to be desiring that people choose from zones associated with United States.

To "GET RID OF THE COUNTRY FIELD ALTOGETHER" is a complicated process, and breaks many normal operations. That would be heavily customized code, and should be done by a programmer who knows Zen Cart very well, and is prepared to re-do those same customizations again when you upgrade next.
So, without knowing the BUSINESS PROBLEM behind all this, I must simply tell you how Zen Cart is designed to work.

16 Jul 2012, 6:02 AM
#5
jeff768 avatar

jeff768

New Zenner

Join Date:
Jan 2012
Posts:
25
Plugin Contributions:
0

Re: Removing Country Checkout Field | US only | State Drop Down

Short and sweet - The Business Problem is making money. I'm not sure why this is being discussed. fundamental sales, least restrictions to close the sale. I guess I'm really looking for zencart technical help over sales philosophy discussions.

i'm selling to US folks only. I can only ship to US folks. I certainly do not need another drop down or reason for any one to leave. Most decent customized us zencart sites do not have the country field.

Admin->Configuration->Customer Details->Create Account Default Country ID to United States - ALREADY SET.

set "My Store: Zone" to your store's state - I HAVE NO STATES TO SELECT FROM.... although i went thru this yesterday and did a fresh rewrite of countries, geo_zones, zones, zones_to_go_zones.

i probably have 70 hours into simplifying the checkout process. it should be 3 hours. until this point i was quite happy with zencart. it's been a nightmare to remove the country field.

IS THERE A WAY TO DEFAULT TO US AND THEN JUST HIDE THE FIELD BY CSS? I have it set to default to us and it still says Please Choose Your Country....argg....

16 Jul 2012, 6:13 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Removing Country Checkout Field | US only | State Drop Down

jeff768:

I guess I'm really looking for zencart technical help over sales philosophy discussions.Of course. But I can't give you technical help if I don't know WHY you went and changed how things were originally designed to work in the first place. And since you didn't offer that information, or at least it wasn't clear, I had to ask.

jeff768:

Admin->Configuration->Customer Details->Create Account Default Country ID to United States - ALREADY SET.

set "My Store: Zone" to your store's state - I HAVE NO STATES TO SELECT FROM....Then you have a database problem.

jeff768:

although i went thru this yesterday and did a fresh rewrite of countries, geo_zones, zones, zones_to_go_zones
You've probably got zones associated with non-existent countries, because you've been deleting records and then manually adding new ones back, but without pointing them to their proper related records. And the most common cause of that is hacking the raw database.

To reset all the country/zone data, you'll need to TRUNCATE (not "EMPTY"), and then restore the original data from these tables:

  • zones
  • geo_zones
  • countries
  • zones_to_geo_zones

And THEN I suppose I can expect you'll be itching to go back into those tables and delete other countries again. You can of course do that, but I would recommend using the admin-supplied controls instead of breaking things in the database again.

16 Jul 2012, 6:21 AM
#7
jeff768 avatar

jeff768

New Zenner

Join Date:
Jan 2012
Posts:
25
Plugin Contributions:
0

Re: Removing Country Checkout Field | US only | State Drop Down

thanks for the reply. i believe the database problem came when i deleted all the countries but the US. with respect to this step below....

To reset all the country/zone data, you'll need to TRUNCATE (not "EMPTY"), and then restore the original data from these tables:

  • zones
  • geo_zones
  • countries
  • zones_to_geo_zones

I did this yesterday. TRUNCATE, nice and clean from another copy of 1.5 on my server. then it killed my ups shipping. just killed it. to the point where i had to pull a copy of the site and database from the 13th and walk on 2 days of work. i'm a bit lerry of this again.

"Yesterday, Zencart and I were friends. Today, not so much."

16 Jul 2012, 6:31 AM
#8
jeff768 avatar

jeff768

New Zenner

Join Date:
Jan 2012
Posts:
25
Plugin Contributions:
0

Re: Removing Country Checkout Field | US only | State Drop Down

Once I get the tables restored, is there a link to how to Remove the country field?

16 Jul 2012, 4:24 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Removing Country Checkout Field | US only | State Drop Down

jeff768:

then it killed my ups shipping. just killed it.What does "killed it" mean? An error message? No quotes? A blank page? Something else?

jeff768:

to the point where i had to pull a copy of the site and database from the 13th and walk on 2 days of work. i'm a bit lerry of this againUnderstandable. That's why when you're making sweeping changes like this it's always smart to do it on a test-copy of your site instead.

When you're doing direct edits in the database, you're bypassing all the protections built-in to the PHP code which preserve all the inter-dependent relationships amongst the various tables. That's why it's safest to use the supplied Admin screens to do these kinds of deletions.

Maybe it would be better if you were to use something like this recently submitted addon: http://www.zen-cart.com/downloads.php?do=file&id=1424 . Of course, it should be tested on a test copy of your site before putting it on your live site. But it seems to accomplish the basics of what you said you seem to be after.

16 Jul 2012, 8:00 PM
#10
jeff768 avatar

jeff768

New Zenner

Join Date:
Jan 2012
Posts:
25
Plugin Contributions:
0

Re: Removing Country Checkout Field | US only | State Drop Down

Thanks again, but it's still crazy.

i did a nice cleanup of the database from a fresh copy. TRUNCATE, looked okay. I downloaded the above utility to turn off the countries. Sure. Seems nice. The shipping estimator on the cart page works fairly well. Checkout is DOA.

Now. as I only have one country, US, the country field does not even pop up on the checkout page. Thus does not pass that value thru, and errors with...

You must select a country from the Countries pull down menu. - suggestions?

10 Aug 2012, 5:29 PM
#11
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Removing Country Checkout Field | US only | State Drop Down

Ever get this working? I too only can sell to US and think it's unfriendly to show United States on the shopping cart and I want to remove it from there.

8 Jan 2021, 4:16 PM
#12
carbonless avatar

carbonless

Zen Follower

Join Date:
Jan 2007
Location:
Illinois, USA
Posts:
329
Plugin Contributions:
0

Re: Removing Country Checkout Field | US only | State Drop Down

I came across this old post today, wondering if there was a quick way to change the countries status' for checkout.

After reading thru the thread, I used my test server to export the countires sql, then manually changed the the status on the countries I wanted to disable, to "0", emptied the countries table, imported the edited data, and then had the couple of countries I wanted.

**NOTE: if you havent worked with MyPHPadmin or other table editing programs, leave this to a developer.

8 Jan 2021, 4:58 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Removing Country Checkout Field | US only | State Drop Down

Carbonless:

wondering if there was a quick way to change the countries status' for checkout.
There are only a couple hundred countries. Clicking the green/red status icon in the Admin Countries screen instantly toggles the status, and only "enabled" countries show at the top of the list. So, fast-clicking those buttons lets you disable all of them in about 2 minutes, maybe a little longer if your webserver is slow.

8 Jan 2021, 5:19 PM
#14
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Removing Country Checkout Field | US only | State Drop Down

Further, if not mistaken, the status field was added for the countries so that they wouldn't "need" to be deleted from the database and possibly at some future point re-added... it appears from the description above that the countries table was in fact deleted (truncated). It is not quite so clear if the repopulation was made using the original data modified for the new status or from some other source. (bring that up because there are some country names added/modified over versions).