Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Country-State Selector


stevel

Recommended Posts

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 by ryanf

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

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.

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by stevel
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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 by magicproshop
Link to comment
Share on other sites

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 by stevel
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

DOH! I completely missed changing the checkout_payment_address and checkout_shipping_address files... I'll work on those and post an update.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

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