Latest News: (loading..)
jcall

Customer Updates - Order Comments

37 posts in this topic

What this contrib does:

=========================

 

This contrib allows customers to add comments to their own orders, even after the order has been finalized.

 

There are many reasons why you may need to email your customers and await feedback from them. There are other reasons why your customers may contact you directly. The purpose of this contrib is to allow that communication to happen directly in osCommerce; thereby removing the need to copy-n-paste communications into the osCommerce admin tool.

 

***IMPORTANT***: This contribution is very simple to install, but requires you to do a little thinking. When the customer submits an update, this code will change the order status. You can either have it change to an existing order status, or make up a completely new status (mine is named Customer Update). You can have the code update the order status to whatever you want, but you have to decide, and then edit the line below, as I've marked it. It is currently hardcoded to 13.

 

To find the numerical value of your order status in the osCommerce administration tool, do the following:

1- Admin > Localization > Orders Status.

2- Click on the order status you'll be using for this contrib

3- Note the URL in your browser. It will be http://YourDomainName/admin/orders_status....age=1&oID=XXXXX, where XXXXX is the order status number. Again, the code is hardcoded to use 13.

 

 

What this contrib does NOT:

===========================

 

This contrib does not allow the customer to modify their order in any way other than add comments. It does not allow them to select the new order status. It will set the order status to the same "Customer Update" (as described above) every time. It does not allow them to add/remove products from their order. Again, they can add comments. That's all.

 

 

Additional uses:

===========================

 

I find it useful to link to the account_historY_info.php page (which requires a login) on the contact_us.php page. This has really cut down on email that asks what the order status is, or if they can have it shipped via SlowBoat rather than Next Day. Allowing customers to put these questions directly into their order means that I don't have to read as much email.

 

Disclaimer:

===========================

 

This contrib has been designed for and tested with osCommerce 2.2 MS2. While it should easily work, perhaps with minor modifications, with other versions of osCommerce, it has not been tested as such.

 

If you find this contribution useful, please support the osCommerce project by becoming an osCommerce Community Sponsor. At the time of this writing, details of Community Sponsorship can be found at http://www.oscommerce.com/about/news,111.

Edited by jcall

Share this post


Link to post
Share on other sites

v1.1 uploaded.

 

Changelog:

1.1 - added proper language string definitions to catalog/includes/languages/english.php

- message stack now works. IOW, when the customer updates their order successfully, they get the little green bar telling them that their order was successfully updated.

- properly closed a previously open-ended comment (Thanks, Thomas!)

 

-jared

Share this post


Link to post
Share on other sites

Okay.

 

Thanks for the contribution.

 

So far I have tried it with money orders and personal checks in a test and when I update the sale after I paid for it and then went into Admin that sale was not listed. I chose all three options, processing, delivered, Pending and all and it showed up no where.

 

I have not tried Paypal yet.

 

Could you look and see why this is making my sails invisible after they have been customer updated.

 

Thank you very much.

 

Lee

Share this post


Link to post
Share on other sites

Did you change the code to set the order status to something other than 13? I tried to make it apparent that I'm using an order status of 13, but nearly everyone will need to create a new order status called "Customer Update" or something like that, find the order status number, and then change the code to reflect that new status number.

 

I suspect that your orders have an order status of 13, which doesn't yet exist in your database. If you go into phpMyAdmin, you should be able to change the order status to something more reasonable (status 1 = Pending in a stock 2.2 MS2 install) until you get the status that you want.

 

-jared

Share this post


Link to post
Share on other sites
I suspect that your orders have an order status of 13, which doesn't yet exist in your database.  If you go into phpMyAdmin, you should be able to change the order status to something more reasonable (status 1 = Pending in a stock 2.2 MS2 install) until you get the status that you want.

 

-jared

 

I found that I did not change the 13 as I should have. I have changed it to 1, Pending. I would like to create my own state.

 

You say go into the database. To what table am I looking? I can probably figure out the rest by myself.

 

Lee

Share this post


Link to post
Share on other sites

In the orders table, find the orders in question, and look for value in the orders_status field. It's probably set to 13 now. Set it to 1, 2, or whatever the value for your new order status is.

 

It should work after you change the code to use your new order status.

 

Please let me know if that fixes it!

 

-jared

Share this post


Link to post
Share on other sites

I'm sorry, I've posted this thread into another topics.

I've just installed your contribution:

It's a great contribution!

But why customers comments have red cross? It's not possible this customer comments have normal green flag?

And it's not possible send an email to admin, or admin and customer?

Thank you Jared

Share this post


Link to post
Share on other sites

red = customer didn't get sent an email

green = customer got sent an email

 

I didn't think there was any point to send the customer an email with the exact text that they just typed in.

 

-jared

Share this post


Link to post
Share on other sites

My question is: it's possible send an email to admin when the customers add comments to their order? Thank you

Share this post


Link to post
Share on other sites

I also have the same question. I ever had installed this contribution. It's very nice. But I uninstall it. Because it can't send an email to admin. If customers have some questions. I did not receive the information and give any answers. Maybe customers will very anger. SO, I think this function is very important. However, Thank you very much.

Share this post


Link to post
Share on other sites

All, sorry I haven't been able to reply earlier. I've been super super busy with some other things I'm working on, and only able to steal a few minutes here and there.

 

I'm sure I can figure out how to email the admin when a customer updates their order. I'm just not sure when I'll be able to get to it. Keep hounding me about it, and hopefully I can get it done within the next few weeks.

 

-jared

Share this post


Link to post
Share on other sites

Here you go: I haven't yet put in the little MySQL pieces to turn this functionality on/off, but here is how you can do it yourself

 

in account_history_info.php, find this:

  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'updated')) {
 $messageStack->add('header', SUCCESS_ORDER_UPDATED, 'success'); 
 }

 

and change it to this:

  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'updated')) {
    tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'Order' . $HTTP_GET_VARS['order_id'] . ' has been updated by the customer.', '', STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); 
 $messageStack->add('header', SUCCESS_ORDER_UPDATED, 'success'); 
 }

 

That's it! (at least it was on my testing server)

 

-jared

Share this post


Link to post
Share on other sites

Thanks for this new function. But I have a new question. Because I have install other contribution. Their function will be effected by the sort number of the order status. If my customers can leave their comments any time. The order status number will become "13". This will effect my other contributions functions. So, how can add a control? Let if order status number is over one number. The customer will can't add his comments. Thanks again!

Share this post


Link to post
Share on other sites

Randy, please refer to the following in the readme:

***IMPORTANT***: This contribution is very simple to install, but requires you to do a little thinking. When the customer submits an update, this code will change the order status. You can either have it change to an existing order status, or make up a completely new status (mine is named Customer Update). You can have the code update the order status to whatever you want, but you have to decide, and then edit the line below, as I've marked it. It is currently hardcoded to 13.

 

To find the numerical value of your order status in the osCommerce administration tool, do the following:

1- Admin > Localization > Orders Status.

2- Click on the order status you'll be using for this contrib

3- Note the URL in your browser. It will be http://YourDomainName/admin/orders_status....age=1&oID=XXXXX, where XXXXX is the order status number. Again, the code is hardcoded to use 13.

 

Use these instructions to change the code to be whatever order status you want.

 

I realize that the right way to do it is to have an admin-configurable order status, but I just didn't (and haven't) had the time to put that in there, which is why it's presently hard coded to 13. You can change it in the code to be whatever order status you want.

 

HTH

 

-jared

Share this post


Link to post
Share on other sites

v 1.2 uploaded to http://www.oscommerce.com/community/contributions,2633 .

 

changes in 1.2:

- added ability to email adminstrator when customer updates order

- other changes to Step 1 for security purposes (Thanks, Nimmit!)

- need to add admin ability (Admin >> Configuration >> Customer Comments) to turn on/off administrator notification when customer updates order

- add more code comments to make modifications easier

- changed one field in Section 2 to be language-defined for ease of use in non-english installations

 

-jared

Share this post


Link to post
Share on other sites
v 1.2 uploaded to http://www.oscommerce.com/community/contributions,2633 .

 

changes in 1.2:

- added ability to email adminstrator when customer updates order

    - other changes to Step 1 for security purposes (Thanks, Nimmit!)

    - need to add admin ability (Admin >> Configuration >> Customer Comments) to turn on/off administrator notification when customer updates order

    - add more code comments to make modifications easier

    - changed one field in Section 2 to be language-defined for ease of use in non-english installations

 

-jared

Hello,

 

I've just installed an updated contribution and I have a question. How customer can add his comments? Where should I look for this option? I made a new order status as Customer Update with the order status number 9. Also in catalog/account_history_info.php where it says:

 

<!-- ***THIS IS THE LINE THAT SETS THE ORDER STATUS.  AS I NOTED, I HAVE IT SET TO 13.  YOU WILL PROBABLY NEED TO SET IT TO SOMETHING ELSE.  -->

                              <?php echo tep_draw_form('status', tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'action=update_order&status=13&' . tep_get_all_get_params(array('action')) , 'SSL')); ?>

<!-- ***THAT WAS THE LINE THAT YOU NEED TO CHANGE.  FOR EXAMPLE, IF YOUR NEW ORDER STATUS IS 7, THEN YOU'D CHANGE THIS LINE TO BE:    <?php echo tep_draw_form('status', tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'action=update_order&status=7&' . tep_get_all_get_params(array('action')) , 'SSL')); ?>  -->

I put:

<?php echo tep_draw_form('status', tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'action=update_order&status=9&' . tep_get_all_get_params(array('action')) , 'SSL')); ?>

I stil can't understand how customer can add any comments to his/her order. Did I miss anything? :-"

 

I'll appreciate your help.

Irina.

Share this post


Link to post
Share on other sites

Login as as cutomer, look at the orders you've placed, and at the bottom of the comments section, you should see a little form to add comments.

 

HTH

 

-jared

Share this post


Link to post
Share on other sites

Wonderful contribution. Currently I have used this contribution on my web site.

I thought that everything works good? but some times on my control panel? costumers? orders?

Some orders do not appear and I have found gaps in the sequence of orders? i.e. Order 410,412, 413, 415, and 416. Etc

 

So the order 414 did not appear, this issue is the same, when a costumer adds any commentary to his order. On another hand, the order was still on the DB. But not on the screen.

Every time that a costumer adds a commentary the order disappears, and the unique way to get the order back is when the admin add a comment to the order from the control panel.

 

I wonder if this is a bug or edge? or if this has some solution

Share this post


Link to post
Share on other sites
some times on my control panel? costumers? orders?

Some orders do not appear and I have found gaps in the sequence of orders? i.e. Order 410,412, 413, 415, and 416. Etc

 

So the order 414 did not appear, this issue is the same, when a costumer adds any commentary to his order. On another hand, the order was still on the DB. But not on the screen.

Every time that a costumer adds a commentary the order disappears, and the unique way to get the order back is when the admin add a comment to the order from the control panel.

 

Yesid, did you change the code, as per the instructions, that sets the order status value? See this in the introduction:

***IMPORTANT***:  This contribution is very simple to install, but requires you to do a little thinking.  When the customer submits an update, this code will change the order status.  You can either have it change to an existing order status, or make up a completely new status (mine is named Customer Update).  You can have the code update the order status to whatever you want, but you have to decide, and then edit the line below, as I've marked it.  It is currently hardcoded to 13.

and this in Step 2:

<!-- ***THIS IS THE LINE THAT SETS THE ORDER STATUS.  AS I NOTED, I HAVE IT SET TO 13.  YOU WILL PROBABLY NEED TO SET IT TO SOMETHING ELSE.  -->

                              <?php echo tep_draw_form('status', tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'action=update_order&status=13&' . tep_get_all_get_params(array('action')) , 'SSL')); ?>

<!-- ***THAT WAS THE LINE THAT YOU NEED TO CHANGE.  FOR EXAMPLE, IF YOUR NEW ORDER STATUS IS 7, THEN YOU'D CHANGE THIS LINE TO BE:    <?php echo tep_draw_form('status', tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'action=update_order&status=7&' . tep_get_all_get_params(array('action')) , 'SSL')); ?>  -->

 

If the code is setting the order status to a status that doesn't exist in your database, then the orders will "disappear". They're still there, just not in a status that anything is checking for.

 

You can use phpMyAdmin or another DB Administration tool to find the orders with a status of 13 and change them to a valid order status. Let me know the specifics if you would like assistance doing that.

 

-jared

Share this post


Link to post
Share on other sites

I installed this contribution and get an error message (top of page) that states 'order not updated, nothing to change". ???

 

I have the order status value set correctly as written in your install.txt.

 

I also have a contribution installed that randomizes the order number (creates a number that is non-sequentional so customers can not see how many orders have passed since last order). It does this only on the front end side. Original order number in database remains the same. Could this contribution be the trouble???

 

Thanks

Share this post


Link to post
Share on other sites
I installed this contribution and get an error message (top of page) that states 'order not updated, nothing to change". ???

 

I have the order status value set correctly as written in your install.txt.

 

I also have a contribution installed that randomizes the order number (creates a number that is non-sequentional so customers can not see how many orders have passed since last order). It does this only on the front end side. Original order number in database remains the same. Could this contribution be the trouble???

 

Thanks

 

Nevermind. I got it working! :)

 

I changed this line of code in account_history_info.php

 

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

 

to this

 

$oID = tep_db_prepare_input($plaintext_order_id);

Share this post


Link to post
Share on other sites

I added this contribution to my set up... I used a new order status called Order Update which was status id 4 - but when I log in as a customer and click update... nothing updates. The text I type is still active in the LIVE text box. Any ideas what I missed?

 

I get no error message.

Share this post


Link to post
Share on other sites

I had the same problem, and I didn't realized that i had skyped STEP 1, check that!

 

In catalog/account_history_info.php, find the following code:

 require('includes/application_top.php');

 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }


AFTER those lines, add the following:

// BEGIN Customer Comments contrib section 1  
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update_order') ) {
   $oID = tep_db_prepare_input($HTTP_GET_VARS['order_id']);
   $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
   $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

// verify that customer is the same one associated with this order
   $customer_check = tep_db_fetch_array(tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"));
   if(tep_not_null($comments) && ($customer_check['customers_id'] == $customer_id))
   {
	$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);

// update the order status in the database
	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 . "'");

// update the order comments in the database
	  tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");

	  $order_updated = true;
	 }
   }

	if ($order_updated == true) {

// send notification email that customer has updated their order
	  if ( (CUSTOMER_COMMENTS_NOTIFY == 'true') && ($HTTP_GET_VARS['action'] == 'update_order') ) {
		  tep_mail(STORE_OWNER, CUSTOMER_COMMENTS_NOTIFY_EMAIL_ADDRESS, 'Order ' . $HTTP_GET_VARS['order_id'] . ' has been updated by the customer', 'Order ' . $HTTP_GET_VARS['order_id'] . ' has been updated by the customer as follows:  ' . $comments, STORE_OWNER, CUSTOMER_COMMENTS_NOTIFY_EMAIL_ADDRESS);
	  }

	  tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, tep_get_all_get_params(array('action')) . 'action=updated'));		 
	} else {
	  tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, tep_get_all_get_params(array('action')) . 'action=not_updated'));
	}
 }


 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'updated')) {
  $messageStack->add('header', SUCCESS_ORDER_UPDATED, 'success');
 }

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'not_updated')) {
  $messageStack->add('header', WARNING_ORDER_NOT_UPDATED, 'warning');
 }
// END Customer Comments contrib section 1

 

Good Luck! ;)

Share this post


Link to post
Share on other sites

Sometimes my customer add blank comment.

It's possible ceck message lenght?

Regards

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now