Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error Messages not working with Simple Visitor contrib


bpmcclure

Recommended Posts

Posted

Hi all,

 

I installed the Simple Visitor Newsletter v1.0 contribution, http://www.oscommerce.com/community/contributions,5196/, but the error messages do not work properly. I get the red bar with and error icon and the code name of the error instead of the text. An example, if the email address is checked and found to already be in the db, the error message is ALREADY_EXIST instead of the text in the language file. I have posted this in the Contribution Support thread for this contribution, but no responses. I think there is a basic code error here, and am hoping someone will spot it right away and get me on the right track.

 

Here is the code that I think does these checks for errors. Hope someone can help!

 

Thanks, Bruce

 

 if (!tep_validate_email($to_email_address)) {

     $error = true;



     $messageStack->add('visitor', ERROR_TO_ADDRESS);

   }

   if ($visitor = tep_db_fetch_array($visitor_query)) { //check if this e-mail already exists in visitor database

     $error = true;

     $messageStack->add('visitor', ALREADY_EXIST);

   } elseif ($customer = tep_db_fetch_array($customer_query)) { //okay, does it exist in our customer database?	

     $error = true;

     $messageStack->add('visitor', ALREADY_EXIST);

   }



   if ($error == false) { // everything is okay

     $sql_data_array = array('email' => $to_email_address);



     tep_db_perform(TABLE_VISITOR, $sql_data_array);



   }

 }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...