Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Comments disappearing in email


Guest

Recommended Posts

Hello again!

 

This time, we've discovered that the remarks we put in to orders.php page in the admin does not reach the customers email. All the checkboxes are marked correctly, and I've tried them both on and off. It seems that if I put only the $comments variable (instead of $notify_comments) in the email section of orders.php, the remarks do appear in the email. But this is a bit inconvenient and only cures the symptom. Not the disease.

 

Furthermore, this makes the blank lines I added for better design permanent. What I have done is an emergency solution, until one kind soul on this forum guides me to a better solution... ;)

 

So this is the orders.php file up to the problem area. And the CVV contrib is installed, but currently inactive.

 

  require('includes/application_top.php');

 

  require(DIR_WS_CLASSES . 'currencies.php');

  $currencies = new currencies();

 

  $orders_statuses = array();

  $orders_status_array = array();

  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");

  while ($orders_status = tep_db_fetch_array($orders_status_query)) {

    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],

                              'text' => $orders_status['orders_status_name']);

    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];

  }

 

  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

  if (tep_not_null($action)) {

    switch ($action) {

      case 'update_order':

        $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

        $status = tep_db_prepare_input($HTTP_POST_VARS['status']);

        $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

 

        $order_updated = false;

        $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

        $check_status = tep_db_fetch_array($check_status_query);

 

        if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {

          tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

          $customer_notified = '0';

          if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {

            $notify_comments = '';

            if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {

              $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";

            }

 

// her har jeg endret $notify_comments . sprintf til kun $comments og slengt p? linjeskift etter

// this is where I changed  $notify_comments . to just $comments and threw in a cursor return

 

            $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $comments . "\n\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

 

            tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

            $customer_notified = '1';

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...