I was having the exact same problem.
Let me outling my problem. (Our store is not live yet.) I could create a new customer account without experiencing a loop (taking me back to select a country). However, as an existing customer I could not update my address when it was time for me to check out. What I also noticed is that in the area to edit the address the state selection was no longer a drop down menu as it was when the account was created.
I narrowed it down to the tpl_modules_address_book_details.php.
Disclaimer: PLEASE, PLEASE backup your site before you attempt my fix. I am using Zen Cart 1.3.7. I am not responsible for any site problems associated with this fix. It does work perfectly on my site. Again, please backup your site before you change your code to what I have changed my code to.
Now, I present to you, my fix...
BEFORE CODE IN THE TPL_MODULES_ADDRESS_BOOK_DETAILS.PHP FILE
Code:
<label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
<?php echo zen_get_country_list('zone_country_id', $entry->fields['entry_country_id'], 'id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
AFTER CODE IN THE TPL_MODULES_ADDRESS_BOOK_DETAILS.PHP FILE
Code:
<label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
<?php if ($process == true) $entry->fields['entry_country_id'] = (int)$_POST['country']; ?>
<?php echo zen_get_country_list('zone_country_id', $entry->fields['entry_country_id'], 'id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
<br class="clearBoth" />
What I added is this line of code:
Code:
<?php if ($process == true) $entry->fields['entry_country_id'] = (int)$_POST['country']; ?>
For me, now there is no longer a loop and now the state is a drop down menu as it should be per my backend settings.
I hope that helps you and saves you time and energy. Please be so kind as to post your results.
Remember...
Disclaimer: PLEASE, PLEASE backup your site before you attempt my fix. I am using Zen Cart 1.3.7. I am not responsible for any site problems associated with this fix. It does work perfectly on my site. Again, please backup your site before you change your code to what I have changed my code to.