For some reason, after installing paypal's website payments pro contrib, users can no longer create accounts. instead i get the message, "Parse error: syntax error, unexpected $end in /home/rlspecia/public_html/create_account.php on line 394"
394 being the last line of the file.
I have very limited php skills, so I simply added the paypal bit in the appropriate place, but it's immediately followed by a pay without account segment of code that looks similar, could they be conflicting?
PHP Code:
//---PayPal WPP Modification START ---//
//$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
$check_email_query = tep_db_query("select customers_id as id, customers_paypal_ec as ec from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
if (tep_db_num_rows($check_email_query) > 0) {
$check_email = tep_db_fetch_array($check_email_query);
if ($check_email['ec'] == '1') {
//It's a temp account, so delete it and let the user create a new one
tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_email['id'] . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$check_email['id'] . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$check_email['id'] . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$check_email['id'] . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$check_email['id'] . "'");
tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$check_email['id'] . "'");
} else {
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
}
//---PayPal WPP Modification END---//
$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
$check_email = tep_db_fetch_array($check_email_query);
// BOF: MOD - PWA
// if ($check_email['total'] > 0) {
// $error = true;
// $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
if ($check_email['total'] > 0) {
//PWA delete account
$get_customer_info = tep_db_query("select customers_id, customers_email_address, purchased_without_account from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
$customer_info = tep_db_fetch_array($get_customer_info);
$customer_id = $customer_info['customers_id'];
$customer_email_address = $customer_info['customers_email_address'];
$customer_pwa = $customer_info['purchased_without_account'];
if ($customer_pwa !='1') {
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
} else {
tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $customer_id . "'");
}
// EOF: MOD - PWA
Bookmarks