Contributions

Features (Category Index)
Search: 

Customer Private Messages

Customer Private Messages v1.0
========================

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

A support thread can be found in the osCommerce forums here:
http://forums.oscommerce.com/index.php?showtopic=201603
***********************
***********************

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.

Includes:
Easy Step by Step Installation
Multiple Screen Shots
GPL

Expand All / Collapse All

Another Correction 18 Jul 2008

I changed the account.php addition to use the .privatemessages entry in the stylesheet.css. Previous submissions asked to add this but the code did not use the addition. I also changed the stylesheet addition to make it a little more appealing. Ofcourse, everyone can make changes as they need to.

Change in account.php from:

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

TO THIS:

<!-- BEGIN Private Message v1.3 -->
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><b><?php echo PRIVATE_MESSAGES_TITLE; ?></b></td>
</tr>
<td>
<table border="0" cellspacing="0" cellpadding="2" class="privatemessages" width="100%"><tr class="infoboxcontents">
<?php
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'deletemessage')) {
tep_db_query("UPDATE " . TABLE_CUSTOMERS . " SET customers_private_messages = ('') where customers_id ='" . (int)$customer_id . "'"); ?>
<tr class="infoboxcontents"><td class="main"><?php echo PRIVATE_MESSAGES_DELETED; ?></td></tr>
<tr class="infoboxcontents"><td class="main"><?php echo PRIVATE_MESSAGES_NO; ?></td></tr>
<?php } else {
$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'] != "") { ?>
<td class="main"><?php echo PRIVATE_MESSAGES_YES; ?></td></tr><tr class="infoboxcontents" ><td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr><td class="infoboxcontents">
<?php echo $result_array['customers_private_messages']; ?></td></tr><tr class="infoboxcontents"><td align="right"><br>
<?php echo tep_draw_form('account', tep_href_link(FILENAME_ACCOUNT, 'action=deletemessage', 'SSL')); ?>
<input type="submit" name="submit" value="delete message">
</form></td></tr>
<?php } else { ?>
<tr><td class="main"><?php echo PRIVATE_MESSAGES_NO; ?></td></tr>
<?php }} ?>
</td>
</tr>
</table>
</tr></table>
<!-- END Private Messages v1.3-->

I also changed the stylesheet.css entry to :

/* Private Message Box */
.privatemessages { font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; color: #ff0000; text-align: left; border-left: 1px solid #ff0000; border-right: 1px solid #ff0000; border-top: 1px solid #ff0000; border-bottom: 1px solid #ff0000; padding-bottom: 2px; padding-top: 2px; padding-right: 2px; padding-left: 2px;}

But again, everyone can change the colors to what they want.

The attached file is just a screenshot of the My Account Information screen.

Hope this is helpful.

Chris

Nice first try icaneat2 but one or two errors where found. 28 Jun 2008
Customer Private Messages - message in checkout_shipping 4 Mar 2008
just a small fix make the message as tables and more. 1 Feb 2008
Customer Private Messages v1.3 26 Mar 2006
Customer Private Messages v1.2 26 Mar 2006
Customer Private Messages v1.1 26 Mar 2006
Customer Private Messages v1.0 26 Mar 2006
Customer Private Messages 26 Mar 2006

Note: Contributions are used at own risk.