Irin Posted December 10, 2005 Posted December 10, 2005 Hello, How can I make State field in create_account.php not required? I'd like it to appear on the create_account page but make it not required in case if my customers don't have a state, so they don't have to invent it. What and where should I change? Thanks.
tina_boots Posted December 10, 2005 Posted December 10, 2005 Hello, How can I make State field in create_account.php not required? I'd like it to appear on the create_account page but make it not required in case if my customers don't have a state, so they don't have to invent it. What and where should I change? Thanks. Change the minimum length value to 0 (zero) in your configuration. Tina If you're not having fun you're not doing it right Teach a person to fish rather than give them a loaf of bread or however that saying goes.
Irin Posted December 10, 2005 Author Posted December 10, 2005 Change the minimum length value to 0 (zero) in your configuration. Tina Tina, thanks for your fast reply. I did exactly how you said but I'm getting an Error message: * Your State must contain a minimum of 0 characters. Is there anything else I must change? Thanks a lot.
tina_boots Posted December 11, 2005 Posted December 11, 2005 Tina, thanks for your fast reply. I did exactly how you said but I'm getting an Error message: Is there anything else I must change? Thanks a lot. Sorry, go to includes/formcheck.js.php and around line 117 find: <?php if (ACCOUNT_STATE == 'true') echo ' check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '");' . "\n"; ?> Commenting out that code should do the trick. Tina If you're not having fun you're not doing it right Teach a person to fish rather than give them a loaf of bread or however that saying goes.
Irin Posted December 11, 2005 Author Posted December 11, 2005 Sorry, go to includes/formcheck.js.php and around line 117 find: <?php if (ACCOUNT_STATE == 'true') echo ' check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '");' . "\n"; ?> Commenting out that code should do the trick. Tina I commented out that code but I'm getting another message now at the top of the create_account.php: Please select a state from the States pull down menu. Any other ideas? Thanks.
tina_boots Posted December 11, 2005 Posted December 11, 2005 I commented out that code but I'm getting another message now at the top of the create_account.php: Any other ideas? Thanks. I tested it before I made my last reply, but I chose a country other than United States and it worked fine. Just now I tried it again picking the US as the country and I do receive the same error message. I'll admit that I was unaware it would function in that manner. However if your customer chose US for the country would you not want the state in that situation to be required? Tina If you're not having fun you're not doing it right Teach a person to fish rather than give them a loaf of bread or however that saying goes.
Irin Posted December 11, 2005 Author Posted December 11, 2005 I tested it before I made my last reply, but I chose a country other than United States and it worked fine. Just now I tried it again picking the US as the country and I do receive the same error message. I'll admit that I was unaware it would function in that manner. However if your customer chose US for the country would you not want the state in that situation to be required? Tina I do require State for US customers but I have many customers who are not from US and, therefore, don't have a State to specify, so they choose any "faked" state just because it's a requirement. Later, I get emails from the customers with a request to disregard State just because they don't have any. In my case I think it better to just remove State requirement from create_account page but still leave this field on a page for US customers. What is your opinion? Thanks.
AlanR Posted December 11, 2005 Posted December 11, 2005 I do require State for US customers but I have many customers who are not from US and, therefore, don't have a State to specify, so they choose any "faked" state just because it's a requirement. Later, I get emails from the customers with a request to disregard State just because they don't have any. In my case I think it better to just remove State requirement from create_account page but still leave this field on a page for US customers. What is your opinion? Thanks. How about defining a new zone named Not Applicable? That would also give you the advantage of being able to set a tax rate for it. You could put a note on the Create Account page. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
Irin Posted December 11, 2005 Author Posted December 11, 2005 How about defining a new zone named Not Applicable? That would also give you the advantage of being able to set a tax rate for it. You could put a note on the Create Account page. This is sounds as a good idea. It might work for me. What should I do to define this new zone? I guess it would require an addition to my database. Thanks.
tina_boots Posted December 11, 2005 Posted December 11, 2005 I do require State for US customers but I have many customers who are not from US and, therefore, don't have a State to specify, so they choose any "faked" state just because it's a requirement. Later, I get emails from the customers with a request to disregard State just because they don't have any. In my case I think it better to just remove State requirement from create_account page but still leave this field on a page for US customers. What is your opinion? Thanks. As far as I understand, if you have a customer who chooses US for their country and does not enter a state when they submit the form will receive an error and be presented with a drop-down list to choose their state. However with the code changes, if a customer chooses a country other than US, and does not enter a state the form will submit without error. I've made this sort of change on a site before and it seemed to work ok. There is probably a more "official" way of doing it, but I'm not quite aware of what it might be. I hope this works for you and I apologize if I've caused you more trouble than help. Be well, Tina If you're not having fun you're not doing it right Teach a person to fish rather than give them a loaf of bread or however that saying goes.
AlanR Posted December 11, 2005 Posted December 11, 2005 This is sounds as a good idea. It might work for me. What should I do to define this new zone? I guess it would require an addition to my database. Thanks. You can do it within admin, I just did. I went to Tax Zones, clicked insert. Defined a new zone named Not Applicable, Clicked Details and selected All Countries as the Country. Under Edit Zone you could leave the Description blank. I've not checked every aspect for pitfalls but it's pretty simple to do (or undo). Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
Irin Posted December 11, 2005 Author Posted December 11, 2005 You can do it within admin, I just did. I went to Tax Zones, clicked insert. Defined a new zone named Not Applicable, Clicked Details and selected All Countries as the Country. Under Edit Zone you could leave the Description blank. I've not checked every aspect for pitfalls but it's pretty simple to do (or undo). Unfortunately, it's not what I needed. I don't really need a new Tax Zone. What I need is to add Not Applicable to a drop-down list of State/Province: in my create_account page, so if customer doesn't have a State he/she will choose Not Applicable from a drop-down menu. How it can be done? Thanks.
AlanR Posted December 11, 2005 Posted December 11, 2005 Unfortunately, it's not what I needed. I don't really need a new Tax Zone. What I need is to add Not Applicable to a drop-down list of State/Province: in my create_account page, so if customer doesn't have a State he/she will choose Not Applicable from a drop-down menu. How it can be done? Thanks. I've never installed the Country-State Selector so I'm not sure where it grabs the State from but you could always add Not Applicable in Zones as well. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
Irin Posted December 11, 2005 Author Posted December 11, 2005 I've never installed the Country-State Selector so I'm not sure where it grabs the State from but you could always add Not Applicable in Zones as well. If I add Not Applicable to Zones, I need to choose Country and Zones Code: for this new Zone. What country should I choose? I need this new zone for every country that doesn't have a State. Thanks.
AlanR Posted December 11, 2005 Posted December 11, 2005 If I add Not Applicable to Zones, I need to choose Country and Zones Code: for this new Zone. What country should I choose? I need this new zone for every country that doesn't have a State. Thanks. How many countries do you sell to? I made the Zone Code N/A and added it to Iraq. B) Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
Irin Posted December 11, 2005 Author Posted December 11, 2005 How many countries do you sell to? I made the Zone Code N/A and added it to Iraq. B) I sell to any country, doesn't matter for me as long as they pay me money. :)
AlanR Posted December 11, 2005 Posted December 11, 2005 It works best if you leave the Zone Code empty, you don't get any abbreviation and the following comma. I did it in phpMyAdmin and I just moved to Iraq. The address looks perfect. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
Irin Posted December 11, 2005 Author Posted December 11, 2005 It works best if you leave the Zone Code empty, you don't get any abbreviation and the following comma. I did it in phpMyAdmin and I just moved to Iraq. The address looks perfect. Yes, but I still need to choose country. And in my case it's not just one country but quite a few. I had customers from Argentina, Denmark and they didn't have any States or Provinces. What country should I choose in this case? Thanks.
AlanR Posted December 11, 2005 Posted December 11, 2005 Yes, but I still need to choose country. And in my case it's not just one country but quite a few. I had customers from Argentina, Denmark and they didn't have any States or Provinces. What country should I choose in this case? Thanks. I'd export the existing table via phpMyAdmin (I have it) This is what it looks like (the last few lines in CSV format): "172";"195";"Sevilla";"Sevilla" "173";"195";"Soria";"Soria" "174";"195";"Tarragona";"Tarragona" "175";"195";"Teruel";"Teruel" "176";"195";"Toledo";"Toledo" "177";"195";"Valencia";"Valencia" "178";"195";"Valladolid";"Valladolid" "179";"195";"Vizcaya";"Vizcaya" "180";"195";"Zamora";"Zamora" "181";"195";"Zaragoza";"Zaragoza" "182";"102";;"Not Applicable" That last line is my Iraq (Country 102). So, you can just add more lines, copy and paste example: Argentina, Denmark "183";"10";;"Not Applicable" "184";"57";;"Not Applicable" I got the country numbers from the country table. When you have all the ones you want just import the table back from this new revised list. Even doing it manually via the admin panel wouldn't take very long. The thing that will take the longest is looking up the country numbers and writing them down. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
Irin Posted December 11, 2005 Author Posted December 11, 2005 I'd export the existing table via phpMyAdmin (I have it) This is what it looks like (the last few lines in CSV format): "172";"195";"Sevilla";"Sevilla" "173";"195";"Soria";"Soria" "174";"195";"Tarragona";"Tarragona" "175";"195";"Teruel";"Teruel" "176";"195";"Toledo";"Toledo" "177";"195";"Valencia";"Valencia" "178";"195";"Valladolid";"Valladolid" "179";"195";"Vizcaya";"Vizcaya" "180";"195";"Zamora";"Zamora" "181";"195";"Zaragoza";"Zaragoza" "182";"102";;"Not Applicable" That last line is my Iraq (Country 102). So, you can just add more lines, copy and paste example: Argentina, Denmark "183";"10";;"Not Applicable" "184";"57";;"Not Applicable" I got the country numbers from the country table. When you have all the ones you want just import the table back from this new revised list. Even doing it manually via the admin panel wouldn't take very long. The thing that will take the longest is looking up the country numbers and writing them down. Where exactly should I insert this lines? Are they going into my database somewhere? This is not the best solution but I might try it. Thanks a lot for your help. I appreciate it.
Irin Posted December 12, 2005 Author Posted December 12, 2005 I added Not Applicable to my drop-down menu and I have another question now. States in a drop-down menu are listed alphabetically and Not Applicable appears somewhere in the middle of the list, so it's very difficult to find it. How can I move it to the top of the list and make it a first option just under Please choose? Thanks.
AlanR Posted December 12, 2005 Posted December 12, 2005 I added Not Applicable to my drop-down menu and I have another question now. States in a drop-down menu are listed alphabetically and Not Applicable appears somewhere in the middle of the list, so it's very difficult to find it. How can I move it to the top of the list and make it a first option just under Please choose? Thanks. <_< You might not like the simplest answer. Just put a space before Not Applicable, it will then appear first in an alpha sort. Anything else is more complicated. Which contribution did you use to get the state pulldown? Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
Irin Posted December 12, 2005 Author Posted December 12, 2005 <_< You might not like the simplest answer. Just put a space before Not Applicable, it will then appear first in an alpha sort. Anything else is more complicated. Which contribution did you use to get the state pulldown? It's really the simplest solution. Let me try it. The contrib I use is "State list dropdown and US default country". Drop-down list is always the same no matter what country has been chosen.
Irin Posted December 12, 2005 Author Posted December 12, 2005 It's really the simplest solution and it works for me. What can be simpler? Now I have my drop-down list starts with Not Applicable. Thanks a lot. You solved my problem. You're genius! :thumbsup:
Guest Posted December 23, 2005 Posted December 23, 2005 You know the joke about those 3 guys climbing on the 60 floor building because the elevator was broken? This mf tiny state field took me 3h! 2.55 of them without the keys. anyway.. the solution: IN YOUR HTTP"S" DIRECTORY : 1. create_account.php: comment the if section starting with : "if (ACCOUNT_STATE == 'true') " . 2. includes/form_check.js.php" delete or comment the line: "<?php if (ACCOUNT_STATE == 'true')" . 2.a) includes/javascript/form_check.js.php" delete or comment the line: "<?php if (ACCOUNT_STATE == 'true')" . 3. in your language file find the "ENTRY_STATE_TEXT" and define it as noothing ! bye.. :'(
Recommended Posts
Archived
This topic is now archived and is closed to further replies.