Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

help setting a flag


Supertex

Recommended Posts

Posted

I've added a field in my orders table (customer_comment_present) that I want set to 1 or 0 based on whether or not a customer has submitted a comment with their order.  

 

I find this in checkout_confirmation: 

  if (!tep_session_is_registered('comments')) tep_session_register('comments');
  if (tep_not_null($HTTP_POST_VARS['comments'])) {
    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
  }

I changed it to:

  if (!tep_session_is_registered('comments')) tep_session_register('comments');
  if (tep_not_null($HTTP_POST_VARS['comments'])) {
    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
    $orderCommentPresent = 1;
  } else {
    $orderCommentPresent = 0;
  }
    $orderCommentPresent = tep_db_prepare_input($HTTP_POST_VARS['orderCommentPresent']);

I know I'll need to edit checkout_process (and the paypal module) to actually write the flag to the DB upon checkout.  So, I added:

 'customer_comment_present' => $order->info['orderCommentPresent']

into the $sql_data_array for 'orders'.  But that's not working.  Forgive my ignorance, but what have I done wrong?

Archived

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

×
×
  • Create New...