Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Private Messages


custodian

Recommended Posts

Customer Private Messages

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

 

I designed this contribution in order to provide an additional means of communication between ourselves and the customers. Customers entered inaccurate or false email addresses; which thereby breaks down the means of interacting with the customer. Invoices fail to reach their destination for many reason, email errors, they moved, change ISP's, exceed mail quota's, do not check their email often or intentionally provided a false email.

 

Additionally there are reasons which do not warrant an email, and sending an email for certain issues may be deemed unprofessional or simply nagging in nature.

 

I needed a means to notify the customer when they would login that their email address is not correct and we cannot contact them, or a simple

 

"We've added the other items that you requested to your order"

"Happy Birthday - We'd like to give you...."

 

The uses are endless.

 

How it works and what it does

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

Once they login successfully and are forwarded to their account information, they will see any Messages that you may have left for them. If there are no messages, it will also inform them of this. I was debating having the box not displayed if there were no messages, but I felt that if they knew there is a messaging system it may remind them to look at it and not quickly skip over it, so if no messages are found it will say so.

 

 

 

**********************************************

Please DO NOT post enhancements, questions, suggestions to the contribution section. My effort is to keep this as clear, straightforward and as easy to understand and install as possible. If you have suggestions, comments or improvements, please post to the forum. I will implement them with future releases. Thank you for understanding and respecting my wishes.

**********************************************

My Contributions

 

Henry Smith

Link to comment
Share on other sites

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

this sounds really neat! :)

is there an option for global messages (such as, sending every customer the same message - like a sale notification)

 

do you have a sample site we can see this in action at?

Link to comment
Share on other sites

this sounds really neat! :)

is there an option for global messages (such as, sending every customer the same message - like a sale notification)

 

do you have a sample site we can see this in action at?

 

"Broadcast" and "Clear All" are two features that I am working on and will have in a later release.

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Error in v1.0 SQL entry

 

Was listed as

 

ALTER TABLE customers ADD private_messages LONGTEXT NOT NULL;

 

should have been

 

ALTER TABLE customers ADD customers_private_messages LONGTEXT NOT NULL;

 

v1.1 corrects with some other trivial corrections

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Hello custodian ! Thank you for your great work .

I made the same function on my site long time ago , BUT yours much more neat and professional.

I added this to index page .

If adding this messages to account page , I think would be better to place some note on index page ,for registered visitors , to view the massege

 

btw I got error on admin/custommerce.php

<td class="main">
<?php
		  if ($processed == true) {
		  echo $cInfo->customers_private_messages . tep_draw_hidden_field('customers_private_messages');
		  } else {
		  echo tep_draw_textarea_field('customers_private_messages', 'soft', '75', '5', ($cInfo->customers_private_messages));
		  }
		  ?></td>

 

there was BR tag after last bracket , so I removed it , but maybe possible just placed it after ?> .

 

again , thank you

Miclosh

Link to comment
Share on other sites

Hello custodian ! Thank you for your great work .

I made the same function on my site long time ago , BUT yours much more neat and professional.

I added this to index page .

If adding this messages to account page , I think would be better to place some note on index page ,for registered visitors , to view the massege

 

btw I got error on admin/custommerce.php

<td class="main">
<?php
		  if ($processed == true) {
		  echo $cInfo->customers_private_messages . tep_draw_hidden_field('customers_private_messages');
		  } else {
		  echo tep_draw_textarea_field('customers_private_messages', 'soft', '75', '5', ($cInfo->customers_private_messages));
		  }
		  ?></td>

 

there was BR tag after last bracket , so I removed it , but maybe possible just placed it after ?> .

 

again , thank you

Miclosh

 

The message location was a draw - My users go to their account page automatically after login,so I opted to place it there AND my index is busy enough :)

 

 

 

I plan on adding a notifier into application_top so that they'll know when they have a message if they are currently logged in.

 

The <BR> tags were from my editor, it was attempting to maintain layout by adding them. I though I got them all - thanks for the heads up... I fix that now.

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Henry,

 

I beleive that in the installation instruction you forgot to add /admin/includes/languages/[language]/customer.php file with the following tag:

 

HEADING_CUSTOMERS_PRIVATE_MESSAGES

 

Because in the admin section that is what you see. So I re-read your installation file (as well as the previous version) but none of them talk about /admin/includes/languages/[language]/customer.php. Can you update your installation file to reflect this?

 

For those who need to know, the quick fix is this:

 

Open /admin/includes/languages/[language]/customer.php and just before ?> add this -

 

define('HEADING_CUSTOMERS_PRIVATE_MESSAGES', 'Private Messages');

 

Save and upload.

 

Thanks for an awesome contribution!

 

Rolly

Link to comment
Share on other sites

Hi,

 

This is an excellent idea! I have attempted to add this mod and pretty much have it done but when I go to the admin and then customers I have this error message:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' c.customers_private_messages customers c left join address_boo

 

select count(*) as total from, c.customers_private_messages customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id

 

[TEP STOP]

Sincerely

Mike

Link to comment
Share on other sites

Hi,

 

This is an excellent idea! I have attempted to add this mod and pretty much have it done but when I go to the admin and then customers I have this error message:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' c.customers_private_messages customers c left join address_boo

 

select count(*) as total from, c.customers_private_messages customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id

 

[TEP STOP]

 

I found the problem. :) For some reason I removed a from in part of the code.

Sincerely

Mike

Link to comment
Share on other sites

Henry,

 

I beleive that in the installation instruction you forgot to add /admin/includes/languages/[language]/customer.php file with the following tag:

 

HEADING_CUSTOMERS_PRIVATE_MESSAGES

 

Because in the admin section that is what you see. So I re-read your installation file (as well as the previous version) but none of them talk about /admin/includes/languages/[language]/customer.php. Can you update your installation file to reflect this?

 

For those who need to know, the quick fix is this:

 

Open /admin/includes/languages/[language]/customer.php and just before ?> add this -

 

define('HEADING_CUSTOMERS_PRIVATE_MESSAGES', 'Private Messages');

 

Save and upload.

 

Thanks for an awesome contribution!

 

Rolly

 

Thanks Rolly - I guess I should stay away from last minute changes when it's 3am >_<

Edited by custodian

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Well done :) Very good contribution

Is there any way to display just a link "you have one privat message" not the hole message in catalog and also in admin?...

thanks

Edited by shaytaan

?,???`???,?? God must love stupid people, he made so many ??,???`???,?

Link to comment
Share on other sites

Well done :) Very good contribution

Is there any way to display just a link "you have one privat message" not the hole message in catalog and also in admin?...

thanks

 

What are you looking for? Possibly a link that pop's open a window with the message?

 

Do you want the same thing in Admin or to simply not see the message preview at all?

Edited by custodian

My Contributions

 

Henry Smith

Link to comment
Share on other sites

What are you looking for? Possibly a link that pop's open a window with the message?

 

Do you want the same thing in Admin or to simply not see the message preview at all?

 

Thanks for the reply,

 

At the Catalog:

I was thinking of a new page with the message, when I click on the link "You have a new message", becouse if the message is big then it destroies the design/layout and fills the hole page...

 

And the same in Admin: In customer listing a link for "Nr. og messages" and open in a new window

 

thanks alot

?,???`???,?? God must love stupid people, he made so many ??,???`???,?

Link to comment
Share on other sites

Thanks for the reply,

 

At the Catalog:

I was thinking of a new page with the message, when I click on the link "You have a new message", becouse if the message is big then it destroies the design/layout and fills the hole page...

 

And the same in Admin: In customer listing a link for "Nr. og messages" and open in a new window

 

thanks alot

 

The message size destroying your layout/design is from the site layout itself.

 

In the catalog/account.php where you placed

 

<!-- BEGIN Private Message v1.0 -->
 <tr>
 <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
 <td class="main"><b><?php echo PRIVATE_MESSAGES_TITLE; ?></b></td>
 </tr>
 </table>
 <table border="0" cellspacing="0" cellpadding="2" class="infoBox" width="100%">
 <tr class="infoBoxContents"><td align="left">
 <?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?>
 <?php $result = tep_db_query("select customers_private_messages from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . " '");
		  $result_array = tep_db_fetch_array($result);
		  if ($result_array['customers_private_messages'] != "") {
		  echo PRIVATE_MESSAGES_YES . "<P>" . $result_array['customers_private_messages'];
		  echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="post">';
		  echo '<input type="submit" name="submit" value="Delete Message">';
		  echo '</form>';
		  if (isset($_POST['submit']))
		  {
		  tep_db_query("UPDATE " . TABLE_CUSTOMERS . " SET customers_private_messages = ('') where customers_id ='" . (int)$customer_id . "'");
		  echo PRIVATE_MESSAGES_DELETED;
		  }
		  } else {
		  echo PRIVATE_MESSAGES_NO;
		  }
		  ?>
 </td></tr></table>
 <!-- END Private Messages -->

 

Adjust the the following items in red according to your site layout. You may choose to make them a fixed width and not a percentage. I choose percentage as the stock default layout has this in the middle of the left and right colum, therefore the 100% would take advantage of the most area it could before wrapping the text. And I also aligned it left to ensure the text was left justified. Your layout could be different, or your customization could be creating a conflict.

 

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo PRIVATE_MESSAGES_TITLE; ?></b></td>

</tr>

</table>

<table border="0" cellspacing="0" cellpadding="2" class="infoBox" width="100%">

<tr class="infoBoxContents"><td align="left">

 

Also depending on your site layout you may want to adjust, remove or add the <table> arrangements

My Contributions

 

Henry Smith

Link to comment
Share on other sites

In admin, go to the customer list.

 

Click on a customer to go into their details.

 

You will see the Private Message Box under the newsletter option in their details.

 

Currently the Customer Private Messages is only for leaving the customer messages - the customer can always email you if needed, but if you can't get in contact with them you're stuck with calling them (if you have a phone number).

 

I'll work something into a future release for the customer replying, possible taking them to the contact us page with auto populating.

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Works. Now I did that to my own account on our website. I checked the message and hit delete. all it does is log me out and take me back to the logon screen. I cannot remove the message.

 

OK, for those you that may have the same issue. Do the following

 

In account.php in the Customers Private Message section look for

 

echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="post">';

 

 

and change it to

// echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="post">';

echo '<form method="post">';

 

 

You only need to change this if it's logging you out

My Contributions

 

Henry Smith

Link to comment
Share on other sites

I'll work something into a future release for the customer replying, possible taking them to the contact us page with auto populating.

... very neat contribution, very good for customer care :-)

 

I think the customer reply action would be a great add-on.

 

Also, if the customer were to get an email everytime admin posted a message then it would be a great excuse to get customer returning to the site:

 

"you have a message from admin, please log in to your account and read the message - thanks"

 

just a thought

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

great contrib!

just to point something out, not a bug.. just a lil typo.

"You Current Have No Private Message"

 

Thanks, I'm working on some cosmetic stuff with it and I'll update that in the next release.

 

Seems IE doesn't like to play nice so I need to add a little spacing into the submit button and another spot.

My Contributions

 

Henry Smith

Link to comment
Share on other sites

  • 2 weeks later...

Hi

 

cannot delet a message when I'm a customer: i'm taken to the login screen over an over. I cleared my sessions table in the database, didn't change anything

 

Thanks for your suggestions

Link to comment
Share on other sites

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...