Hi Everyone:
I added to this contribution concerning the twitter issue @@thejudge99 mentioned and I also experienced. This also applies to fb accounts and google accounts. Basically it runs a check to make sure address is a valid one and if it is not returns the Update Address page with an alert saying "You have logged in using a social media account that does not give us required information. Please fill in the required fields to create an account or continue to browse" The user can at this point add their address or be sent to a browsing mode.
So as thanks for contribution in the first place, here is as promised my "force address" mod for it:
1) Please add the below function to includes/functions/general.php
##############################################
function tep_check_valid_address()
{
global $messageStack;
if( !isset($_SESSION['customer_id'])) return;
if(!strstr($_SERVER['PHP_SELF'],CONTENT_ADDRESS_BOOK_PROCESS.'.php') &&
!strstr($_SERVER['PHP_SELF'],CONTENT_LOGOFF.'.php') &&
!strstr($_SERVER['PHP_SELF'],CONTENT_ACCOUNT_EDIT.'.php')
) {
/* first make sure the user does have a valid email address */
$valid_email_query = tep_db_query(" SELECT customers_email_address FROM ".TABLE_CUSTOMERS." WHERE customers_id = " .(int)$_SESSION['customer_id']);
$valid_email_result = tep_db_fetch_array($valid_email_query);
if( $valid_email_result['customers_email_address'] == '' ) {
$messageStack->add_session('account_edit', sprintf(IS_VALID_ACCOUNT, tep_href_link(FILENAME_LOGOFF, 'to=home', 'NONSSL', false) ), 'error');
tep_redirect(tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'NONSSL', false));
}
$addresses_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
$addresses = tep_db_fetch_array($addresses_query);
if($addresses['total'] == 1) {
$single_address_query = tep_db_query("select * from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
$single_address_res = tep_db_fetch_array($single_address_query);
if( $single_address_res['entry_street_address'] == '' ||
$single_address_res['entry_street_address'] == 'default' ||
$single_address_res['entry_postcode'] == '' ||
$single_address_res['entry_postcode'] == 'default' ||
$single_address_res['entry_city'] == '' ||
$single_address_res['entry_city'] == 'default'
) {
$messageStack->add_session('addressbook', sprintf(IS_VALID_ACCOUNT, tep_href_link(FILENAME_LOGOFF, 'to=home', 'NONSSL', false) ), 'error');
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit='.$single_address_res['address_book_id'], 'NONSSL', false));
}
} elseif($addresses['total'] == 0) {
$messageStack->add_session('addressbook', sprintf(IS_VALID_ACCOUNT, tep_href_link(FILENAME_LOGOFF, 'to=home', 'NONSSL', false) ), 'error');
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'NONSSL', false));
}
}
}
2) Add the below function to the includes/application_top.php file at last
############################################
tep_check_valid_address();
3) Add the following code to includes/english/core.php
###########################################
define('IS_VALID_ACCOUNT','You have logged in using a social media account that does not give us required information. Please fill in the required fields to create an account or <a href="%s">browse without account.</a>');