This could clean it up automatically when they login (assuming they log in directly):
/includes/modules/pages/login/header_php.php
Code:
$messageStack->add('login', TEXT_LOGIN_ERROR);
} else {
if (SESSION_RECREATE == 'True') {
zen_session_recreate();
}
if ($check_customer->fields['customers_default_address_id'] == 0) {
$sql = "SELECT address_book_id
FROM " . TABLE_ADDRESS_BOOK . "
WHERE customers_id = :customersID";
$sql = $db->bindVars($sql, ':customersID', $check_customer->fields['customers_id'], 'integer');
$test = $db->Execute($sql);
if ($test->RecordCount() == 1) {
$sql = "UPDATE " . TABLE_CUSTOMERS . " SET customers_default_address_id = :addressBookID WHERE customers_id = :customersID";
$sql = $db->bindVars($sql, ':customersID', $test->fields['customers_id'], 'integer');
$sql = $db->bindVars($sql, ':addressBookID', $test->fields['address_book_id'], 'integer');
$result = $db->Execute($sql);
$check_customer->fields['customers_default_address_id'] = $test->fields['address_book_id'];
} else {
$messageStack->add_session('header', 'ALERT: There seems to be a problem with your address book entries. Please re-select your primary address before going through checkout.', 'error');
$address_book_error = TRUE;
//zen_redirect(zen_href_link(FILENAME_ADDRESS_BOOK, '', $request_type));
}
}
$check_country_query = "SELECT entry_country_id, entry_zone_id
and, same file, about 20 lines later:
Code:
$_SESSION['cart']->restore_contents();
// eof: not require part of contents merge notice
if (isset($address_book_error) && $address_book_error == TRUE) {
zen_redirect(zen_href_link(FILENAME_ADDRESS_BOOK, '', $request_type));
}
Bookmarks