stevel Posted April 20, 2004 Share Posted April 20, 2004 This topic is for discussion about and support of the Country-State Selector contribution. 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...
ryanf Posted April 20, 2004 Share Posted April 20, 2004 (edited) This is what I have between 195 and 210 } ? ? ?} ? ? ?$messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED, 'success'); ? ? ?tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); ? ?} ?} // +Country-State Selector } // -Country-State Selector ? I am going to go through the instructions again and see if I messed up Edited April 20, 2004 by ryanf Quote If I was crafty, this would be a funny signature. Link to comment Share on other sites More sharing options...
ryanf Posted April 20, 2004 Share Posted April 20, 2004 Never mind I fixed the problem I was having. Copy and Pasting out of the html file doesn't work too well, all the lines paste as one line and you have to then hit enter where they should all be. I missed one and one of the lines was commented out. Quote If I was crafty, this would be a funny signature. Link to comment Share on other sites More sharing options...
stevel Posted April 20, 2004 Author Share Posted April 20, 2004 Sorry about the HTML - I will fix that today. I see someone made a few suggestions in the contribution download area (not the best place for that, admittedly!) I'll probably work those in and post an update. Please 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...
tower Posted April 20, 2004 Share Posted April 20, 2004 Hello all, Nice contrib, but i have one problem with it. When editing an existing second adress in the adress-book (adress_book_process.php?edit=), and i change the country, it will jump back to the country that i want to change... Can somebody confirm this behaviour. (Might be I installed something else, that causes this, not sure about ....) greetings tower Quote Link to comment Share on other sites More sharing options...
stevel Posted April 20, 2004 Author Share Posted April 20, 2004 (edited) Yes, I can confirm this. I could have sworn I tested this case... Worse, if the country has zones, it doesn't preselect the old zone/state. I haven't figured out a solution yet - I'll work on it. If anyone else can figure it out, please chime in. The code for the address_book is more complex than that for create_account, as it has to deal with the existing entry. I think I over-simplified. Edited April 20, 2004 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 21, 2004 Author Share Posted April 21, 2004 Ok, I see what's wrong and how to fix it. Give me another day... my brain is a bit too fuzzy from lack of sleep right now. Basically, in address_book_process.php, I have to recreate the $entry array from the post values from the refreshed form. Then there's the matter of the code in address_book_details.php not being quite right either... Stay tuned... 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 21, 2004 Author Share Posted April 21, 2004 Version 1.0.1 posted, with all fixes. The major changes were in the two address book files, though I added a (int) cast to the query in create_account.php. I also fixed the formatting of the HTML file to make copy/paste work. Please let me know of any problems. Enjoy! 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...
magicproshop Posted April 21, 2004 Share Posted April 21, 2004 (edited) First of all thanks for this contribution. I have a rather modified store and I have installed the contribution to a T but don't have it working completely. I get the following error on the catalog/address_book_process.php file. Parse error: parse error in /home/virtual/site3/fst/var/www/html/newstore2/address_book_process.php on line 190 Here is what the block of code looks like in that area. (Showing lines 183-209) ? ? ?$messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED, 'success'); ? ? ?tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); ? ?} ?} // +Country-State Selector } ? if ($refresh) { ? ? // Recreate $entry from post values collected above ?$entry = array( ? ?'entry_firstname' => $firstname, ? ?'entry_lastname' => $lastname, ? ?'entry_street_address' => $street_address, ? ?'entry_postcode' => $postcode, ? ?'entry_city' => $city, ? ?'entry_state' => "", ? ?'entry_zone_id' => (int)0, ? ?'entry_country_id' => (int)$country); ? if (ACCOUNT_GENDER == 'true') $entry['entry_gender'] = $gender; ? ? ?if (ACCOUNT_COMPANY == 'true') $entry['entry_company'] = $company; ? ? ?if (ACCOUNT_SUBURB == 'true') $entry['entry_suburb'] = $suburb; ? ?} ?else // -Country-State Selector ? ?$entry_query = tep_db_query("select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'"); Any help would be greatly appreciated. Thank you Edited April 21, 2004 by magicproshop Quote Arizona Patent Services Link to comment Share on other sites More sharing options...
stevel Posted April 21, 2004 Author Share Posted April 21, 2004 (edited) Damn - my error. The group for line 191 should end with: if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) { which was an original line. I'll fix the docs and re-upload. Sorry! Edited April 21, 2004 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...
magicproshop Posted April 21, 2004 Share Posted April 21, 2004 (edited) deleted message. Edited April 22, 2004 by magicproshop Quote Arizona Patent Services Link to comment Share on other sites More sharing options...
magicproshop Posted April 22, 2004 Share Posted April 22, 2004 For some reason that same line is still giving me the same error. Parse error: parse error in /home/virtual/site3/fst/var/www/html/newstore2/address_book_process.php on line 190 Any ideas? Thanks again for the assistance. Quote Arizona Patent Services Link to comment Share on other sites More sharing options...
magicproshop Posted April 22, 2004 Share Posted April 22, 2004 Ok when I remove the } the address_book.php page loads fine and I don't get the message I listed in the previous post. But when I then click "edit" or "delete" in the address section to edit or delete an address the javascript kicks in and refreshes the page and adds a blank address. Sorry my poor programing skill is certainly coming thru. Any ideas? Quote Arizona Patent Services Link to comment Share on other sites More sharing options...
stevel Posted April 22, 2004 Author Share Posted April 22, 2004 Send your address_book_process.php file to me at webmaster at cheshiregarden dot com. I assume you meant address_book_process.php and not address_book.php in the last post. 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...
Guest Posted April 22, 2004 Share Posted April 22, 2004 I found the problem that others are complaining about, it has to do with the HTML cut&paste issue once again I'm nearly certain. When you copy&paste the code for the line 55 replacement in address_book_process.php from the html file, the code is pasted like this: // +Country-State Selector if ($process) { // -Country-State Selector if (ACCOUNT_GENDER == 'true') { When it should be entered like this: // +Country-State Selector if ($process) { // -Country-State Selector if (ACCOUNT_GENDER == 'true') { Check your address_book_process.php around line 63 and make sure that "// -Country-State Selector" line has a return after it. ;) Awesome contribution, thanks. B) Quote Link to comment Share on other sites More sharing options...
magicproshop Posted April 22, 2004 Share Posted April 22, 2004 Oarie, Thanks for the info I went in and made the change and it work PERFECTLY. Thanks Quote Arizona Patent Services Link to comment Share on other sites More sharing options...
stevel Posted April 22, 2004 Author Share Posted April 22, 2004 Interesting.. I think I see what in the HTML is causing that and will fix it. Or perhaps I should just do text like everyone else - sigh. That's what I get for trying to be modern! B) 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...
Guest Posted April 22, 2004 Share Posted April 22, 2004 It's the <pre></pre> tags. ;) Quote Link to comment Share on other sites More sharing options...
stevel Posted April 22, 2004 Author Share Posted April 22, 2004 In particular, it's a segment broken into two <pre> sections. I'll make sure I re-test the HTML before I re-post it. 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...
deepfreeze Posted April 24, 2004 Share Posted April 24, 2004 Superb contribution, this is just what I'm looking for. However, I'm having the same problems as above but i did not cut from HTML I opened your file in MacroMedia so I could just cut the text as is. My parse error was line 196 unexpected } when this was removed as described above I too get blank entries whether trying to edit or delete. Loaded version 1.03 Quote Link to comment Share on other sites More sharing options...
deepfreeze Posted April 24, 2004 Share Posted April 24, 2004 Superb contribution, this is just what I'm looking for. However, I'm having the same problems as above but i did not cut from HTML I opened your file in MacroMedia so I could just cut the text as is. My parse error was line 196 unexpected } when this was removed as described above I too get blank entries whether trying to edit or delete. Loaded version 1.03 Well sorry for this , it would seem i missed the deletion of a little code on the line 100 replacement - alls seems to be okily dockily :D Regards Andy Quote Link to comment Share on other sites More sharing options...
stevel Posted April 27, 2004 Author Share Posted April 27, 2004 DOH! I completely missed changing the checkout_payment_address and checkout_shipping_address files... I'll work on those and post an update. 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 28, 2004 Author Share Posted April 28, 2004 Update 1.0.4 posted with support for Update Address during checkout. Only new files in this update, you can leave previously edited files alone. I seem to have discovered a simpler approach on this latest version, but I'm not going back to "simplify" the older files. If I've made any mistakes here, be sure to let me know! I am pretty sure the HTML is ok this time! 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...
Guest Posted April 28, 2004 Share Posted April 28, 2004 Update 1.0.4 posted with support for Update Address during checkout. Only new files in this update, you can leave previously edited files alone. I seem to have discovered a simpler approach on this latest version, but I'm not going back to "simplify" the older files. If I've made any mistakes here, be sure to let me know! I am pretty sure the HTML is ok this time! "Only new files"? Does the 1.0.4 contain "all" the files I need, or do I need to get 1.0.3 and 1.0.4? Sorry If I'm too tired to understand exactly what you meant. 10-month old little kids can sure keep a guy up late at night. --Jeff Quote Link to comment Share on other sites More sharing options...
Guest Posted April 28, 2004 Share Posted April 28, 2004 Too late to edit, darn. I guess I answer me own Q's by looking in the zip myself. Looks like all the files are there. Oh, what a day. :blink: Quote 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.