stevel Posted April 14, 2005 Author Share Posted April 14, 2005 Dandelion, here's what to do. Replace this code in create_account.php: <tr> <td class="main"><?php echo ENTRY_COUNTRY; ?></td> <?php // +Country-State Selector ?> <td class="main"><?php echo tep_get_country_list('country',$country,'onChange="return refresh_form(create_account);"') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td> <?php // -Country-State Selector ?> </tr> with this: <?php echo tep_draw_hidden_field('country', DEFAULT_COUNTRY); ?> You'll need to make a similar change in includes/modules/address_book_details.php KD, I'm still working on your problem. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
dandelion Posted April 14, 2005 Share Posted April 14, 2005 Dandelion, here's what to do. Replace this code in create_account.php: <tr> ?<td class="main"><?php echo ENTRY_COUNTRY; ?></td> ?<?php // +Country-State Selector ?> ? <td class="main"><?php echo tep_get_country_list('country',$country,'onChange="return refresh_form(create_account);"') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td> ?<?php // -Country-State Selector ?> </tr> with this: ? ? ?<?php echo tep_draw_hidden_field('country', DEFAULT_COUNTRY); ?> You'll need to make a similar change in includes/modules/address_book_details.php KD, I'm still working on your problem. <{POST_SNAPBACK}> Thanks so very much that's got it! Ruth Quote Link to comment Share on other sites More sharing options...
dandelion Posted April 14, 2005 Share Posted April 14, 2005 <{POST_SNAPBACK}> I'm getting an error in the checkout confirmation for delivery and billing address Warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/html/catalog/includes/functions/general.php on line 42 Is this something I did installing this contribution? Do you know how to fix it? Thanks Ruth My Webpage Quote Link to comment Share on other sites More sharing options...
stevel Posted April 14, 2005 Author Share Posted April 14, 2005 Ruth, I tried this on my own site and didn't see a problem. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
stevel Posted April 15, 2005 Author Share Posted April 15, 2005 KJ, the change I suggested earlier is bad. As I suspected, it fails to set the zone. Try this instead. Undo the commenting-out I suggested before. Replace this one line: $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')"); with this: $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "')"); Let me know how this works for you. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
dandelion Posted April 15, 2005 Share Posted April 15, 2005 I'm getting an error in the checkout confirmation for delivery and billing address Warning: htmlspecialchars() expects parameter 1 to be string, array given in /var/www/html/catalog/includes/functions/general.php on line 42 Is this something I did installing this contribution? Do you know how to fix it? Thanks Ruth My Webpage <{POST_SNAPBACK}> I'm trying to get to the bottom of this in the bug fix section http://www.oscommerce.com/community/bugs,1291 Thanks so much for helping me get the country province pulldown fixed. FYI I changed the newsletter subscription in this to a radio button so if someone checks it but changes their mind they can unsubscribe again. Do you know how to fix the phone number on this file so that it requires inclusion of the area code - I know it's something to do with the required number of characters but where do I do that. Ruth Quote Link to comment Share on other sites More sharing options...
stevel Posted April 15, 2005 Author Share Posted April 15, 2005 You set the minimum number of digits in admin under "Minimum values". Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
clearasmud Posted April 15, 2005 Share Posted April 15, 2005 This topic is for discussion about and support of the Country-State Selector contribution. <{POST_SNAPBACK}> I don't know if this has been addressed before or not, but... I installed (at least partially) your contribution, but since I am using the PWA contribution, I am no longer using create_account.php. I tried using your code in create_account in Order_Info_Check, etc., but so far am unsuccessful. It may be easy if I had a good or even decent knowledge of php. Anyway, just wanted to check if this has been addressed. Quote Link to comment Share on other sites More sharing options...
stevel Posted April 15, 2005 Author Share Posted April 15, 2005 There was one earlier post but nothing after that. I have not used PWA myself. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
clearasmud Posted April 16, 2005 Share Posted April 16, 2005 There was one earlier post but nothing after that. I have not used PWA myself. <{POST_SNAPBACK}> Thank for your response. I thought your link would take me to the earlier post, but the link takes me back to your state-selector contribution. Is that what you meant to do? In any event, thanks again. Quote Link to comment Share on other sites More sharing options...
stevel Posted April 16, 2005 Author Share Posted April 16, 2005 Well, it goes directly to the post for me. Try this one? Not that it will be helpful, except to give you a member name you can perhaps send a PM to to ask if they ever got it working. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
SnyderHealth Posted April 17, 2005 Share Posted April 17, 2005 Hi all. This is a great contribution.. especially when it was working correctly. :'( I have no clue as to what changes I ever made in the past to stop this contribution from working, but here is my prob... The page does not refresh when a different country is selected. I have double, triple, and quadruple checked everything... Made some of the requested changes... nadda. In Firefox, I am getting the javascript console to say "Error: refresh_form is not defined" but when I do a check of the html code in "view source" I see the function for refresh_form. I AM GOING BONKERS AS I HAVE READ EVERY SINGLE LINE IN THE TOPIC AND STILL CANNOT GET THIS TO WORK AS IT USED TO!! ARGGGGHHHHHH!! :angry: Please, for the love of God, can someone (Steve?) take a look at my site and tell me what is wrong? PLEEEEEEEEEEEEASE. By the way, the site is http://shop.snyderhealth.com (click here to go straight to create_account.php) Somewhere it lies in the refresh_form stuff, but it is baffling me at this point... my eyes are bleeding. Thanks to anyone who can help. Again, this is an awesome contribution! Quote Link to comment Share on other sites More sharing options...
SnyderHealth Posted April 17, 2005 Share Posted April 17, 2005 Just a quick mention, I am also getting a java console error message of "Error: check_form is not defined". In case that helps with diagnosing this. Thanks again. Quote Link to comment Share on other sites More sharing options...
stevel Posted April 17, 2005 Author Share Posted April 17, 2005 Well, one thing you appear to have done was add <font color="red" size="1"> to the various ENTRY_xxx_ERROR defines in english.php. The problem with this is that the defines are referenced in includes/form_check_js.php inside strings delimited with "". That makes the embedded " characters give a JavaScript syntax error, and this could have bad effects on the rest of the JavaScript. Try editing the calls to check_input in form_check_js.php to use apostrophe delimiters and see if that helps. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
jspivey Posted April 20, 2005 Share Posted April 20, 2005 First off, great contrib. Thanks. A note on "includes_modules/checkout_new_address.php". Line 80 instructions read: // +Country-State Selector $zones_array = array(); $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = " . $country . " order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } if (count($zones_array) > 0) { echo tep_draw_pull_down_menu('state', $zones_array); } else { echo tep_draw_input_field('state'); } // -Country-State Selector $country should be replaced by (int)$country in the query. Also a note. Because $country has not been set the first time this page is viewed, the state box comes up as a standard text box. Not a big deal. What I did was add this in the line 80 instructions: // +Country-State Selector // ADDED TO CONTRIB if(!$country){ $country = DEFAULT_COUNTRY; } // ADDED TO CONTRIB $zones_array = array(); $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = " . (int)$country . " order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } if (count($zones_array) > 0) { echo tep_draw_pull_down_menu('state', $zones_array); } else { echo tep_draw_input_field('state'); } // -Country-State Selector Quote Link to comment Share on other sites More sharing options...
stevel Posted April 20, 2005 Author Share Posted April 20, 2005 Interesting - I haven't seen this behavior. I will have to take a look. Thanks. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
stevel Posted April 23, 2005 Author Share Posted April 23, 2005 (edited) Ah, I see. In the readme, I left out the following code that is supposed to be in both checkout_shipping_address.php and checkout_payment_address.php // +Country-State Selector if (!isset($country)){$country = DEFAULT_COUNTRY;} // -Country-State Selector Those are the only two files checkout_new_address.php is used from. The code does appear in the pre-edited files I supply. Sorry about that. I'll agree that there really should be an (int) before $country - thanks. I can see a few other improvements I would like to make, and will work on it over the next few days. Edited April 23, 2005 by stevel Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
stevel Posted April 24, 2005 Author Share Posted April 24, 2005 I should not have been so quick to apologize - those changes ARE in the readme.... I just uploaded version 1.2 which takes care of the "zone name is substring of another zone name" issue for create_account.php - this was already being done for the other pages. Also some minor bugfixes. See the readme for the change log. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
pcferreira Posted April 30, 2005 Share Posted April 30, 2005 (edited) Hi Steve. Sorry for my english. I am from Brazil... I made all the changes in the README but I can't see the page create_account.php after the replacements. I made them again but it didn't work anyway. So could you help me? I can send you my create_account.php so you can take look... Thanks a lot. PS: The other changes are working great! -- PC Edited April 30, 2005 by pcferreira Quote PC Link to comment Share on other sites More sharing options...
pcferreira Posted April 30, 2005 Share Posted April 30, 2005 Forget about it!!! Now it is working fine.... don't ask me why... hehehehe Thank u anyway. -- PC Quote PC Link to comment Share on other sites More sharing options...
SnyderHealth Posted April 30, 2005 Share Posted April 30, 2005 Well, one thing you appear to have done was add <font color="red" size="1"> to the various ENTRY_xxx_ERROR defines in english.php. The problem with this is that the defines are referenced in includes/form_check_js.php inside strings delimited with "". That makes the embedded " characters give a JavaScript syntax error, and this could have bad effects on the rest of the JavaScript. Try editing the calls to check_input in form_check_js.php to use apostrophe delimiters and see if that helps. <{POST_SNAPBACK}> Thanks Steve brother!! I removed all of the <font color="red" size="1"> from english.php, and now IT WORKS!!! lol Not sure why or when I put those in there, but I don't know why I didn't trace that back. Thanks for opening my eyes a bit. Now I can continue on with my life! Dean Quote Link to comment Share on other sites More sharing options...
richhoward Posted May 4, 2005 Share Posted May 4, 2005 How do you make it where you can only select United States as a country, we wont be shipping outside the USA? Quote Link to comment Share on other sites More sharing options...
stevel Posted May 4, 2005 Author Share Posted May 4, 2005 See here. Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
homewetbar Posted May 10, 2005 Share Posted May 10, 2005 Looks like it will be a great addition to my site, however I am having one problem in testing. Since my login and create account are combined into one page it seems to be interfering with the login part of the site. Any ideas as to why and how to fix it? Thanks! Quote Most Valuable OsCommerce Contributions: Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294 FedEx Automated Labels -- Contribution 2244 RMA Returns system -- Contribution 1136 Sort Products By Dropdown -- Contribution 4312 Ultimate SEO URLs -- Contribution 2823 Credit Class & Gift Voucher -- Contribution 282 Cross-Sell -- Contribution 5347 Link to comment Share on other sites More sharing options...
stevel Posted May 10, 2005 Author Share Posted May 10, 2005 How many fingers am I holding up? :D This is a joking way of saying "you haven't supplied enough information for me to make any sort of rational guess." The part of C-S Selector that requires care to integrate with other contribs is its addition of the "refresh" action. Study what it does when a refresh is done and make sure that it can also do this on your page. Other contribs may make some assumptions about the actions (for example, assuming that any submission of the form is an attempt to log in or create an account.) Quote Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.