Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can You Keep (Private) Notes In An Order?


craigan

Recommended Posts

Hello,

 

Does anyone know if there's something (contribution) that will allow me to put notes in a customer's order without them being able to see my notes when they look at their order in their order history?

 

Best Regards,

Craig

Link to comment
Share on other sites

I didn't know that they could see the notes in the order history??

 

Oops :rolleyes: Hope there's nothing too personal written in there then!

 

Customers log into their account and then view the order along with its history.......

Link to comment
Share on other sites

  • 2 weeks later...

As far as I know you can add a comment and deselect the "notify customer" button. This will add the comment for records but not allow customer to be notified.

Everythings Just Great!

Link to comment
Share on other sites

As far as I know you can add a comment and deselect the "notify customer" button. This will add the comment for records but not allow customer to be notified.

 

If you deselect the "notivy customer" then it won't send them an email with the new comments. However, if they log into their account history and view the order, they are still able to see the comments. I'm still trying to figure out an answer for this one....

Link to comment
Share on other sites

  • 3 weeks later...
If you deselect the "notivy customer" then it won't send them an email with the new comments. However, if they log into their account history and view the order, they are still able to see the comments. I'm still trying to figure out an answer for this one....

 

 

I have the same issue, if you uncheck the notify customer field it does not email the customer but the comments are still visible in when the customer logs in. --- Still hunting for a solution ---

Link to comment
Share on other sites

The better way to do it would be to add a switch variable to the database so you could differentiate the notes (seen or not seen). But a quick way to do it would be to use some special code in the note that is unlikely to be entered by anyone, like 123$sdf!12. Then in the code of account_history_info.php, change this

  $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");

to this

  $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and osh.comments NOT LIKE '123$sdf!12%' and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");

I haven't tested the above but I think it should work.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 1 month later...
The better way to do it would be to add a switch variable to the database so you could differentiate the notes (seen or not seen). But a quick way to do it would be to use some special code in the note that is unlikely to be entered by anyone, like 123$sdf!12. Then in the code of account_history_info.php, change this
  $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");

to this

  $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and osh.comments NOT LIKE '123$sdf!12%' and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");

I haven't tested the above but I think it should work.

 

Jack

 

geeze, add the freaking field to osh called custhide with a 1 or a 0 default = 0. add a radio button to the admin orders.php that allows you to set it to a 1 when you add a comment (Hidden Comment: yes 0 no X) and shows (hidden comment) in the display of orders in a different font colour in the admin display. Then modify that one select statement to only select comments where osh.custhide = '0'.

 

Then it's nice and clean and that took all of 5 minutes. This isn't rocket science.

Link to comment
Share on other sites

Then it's nice and clean and that took all of 5 minutes. This isn't rocket science.

 

1) added field to database table orders_status_history called custhide int(1) with a default value of 0

 

2) modified the code to get and display in account_history_info.php to:

 

 $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments, osh.custhide from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");
 while ($statuses = tep_db_fetch_array($statuses_query)) {
if ($statuses['custhide'] != 1) {
echo '			  <tr>' . "\n" .
	 '				<td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" .
	 '				<td class="main" valign="top" width="70">' . $statuses['orders_status_name'] . '</td>' . "\n" .
	 '				<td class="main" valign="top">' . (empty($statuses['comments']) ? ' ' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" .
	 '			  </tr>' . "\n";
 }
 }

 

3) modified the following in the admin/orders.php

 

	  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']);
// added hidden comments from customer
   $custhide = 0;
   if ($custhide == 'on') $custhide = 1;
	$order_updated = false;

 

later in the update the insert to the db is changed to:

 

 tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, custhide) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "', '" . tep_db_input($custhide)  . "')");

 

later in the code, when I display the form to the admin I have to make changes that show when a comment was hidden... so first I have to change the SQL to get the flag and display it properly (I display hidden comments in green)

 

	$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, custhide, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
if (tep_db_num_rows($orders_history_query)) {
  while ($orders_history = tep_db_fetch_array($orders_history_query)) {
	echo '		  <tr>' . "\n" .
		 '			<td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
		 '			<td class="smallText" align="center">';
	if ($orders_history['customer_notified'] == '1') {
	  echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
	} else {
	  echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
	}
	echo '			<td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>';
	if ($orders_history['custhide'] == '1') {
		 echo '			<td class="smallText"><font color=green>' . nl2br(tep_db_output($orders_history['comments'])) . ' </font></td>';
	 } else {
		 echo '			<td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>';
	 }

		 '		  </tr>' . "\n";
  }

 

Then I have to add the checkbox to hide the comment (note: the default is to send comments to customers, a cleaner way would be to set this to a radio that says if you don't send the comment it's hidden... but this is a fast hack, so you have to uncheck one and check the other).

 

			  <tr>
			<td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>
			<td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>
			<td class="main"><b>Hide Comment: </b> <?php echo tep_draw_checkbox_field('custhide', '', false); ?></td>
		  </tr>

 

and there you have it, a quick kluge that will allow you to enter comments and set them not seen by the customer.

 

If I was really doing it right, I would allow you to pick a date as well so you could "calendar" a comment. Then I would add a calendar function that would allow you to see all comments calendared for a specific date or date range and view those orders. But I said 5 minutes so I tried to do it in 5 minutes... it took 7 with testing...

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...