Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Private Messages


custodian

Recommended Posts

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

I replaced

 

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

 

by

 

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

 

and it still doesn't work: I am now redirected to the home page, logged off instaed of the login page

 

Any suggestion?

Link to comment
Share on other sites

  • 3 weeks later...

Hey all,

I wanted a little php coding advice if possible. I am using Linda McGrath's Login Box and have Customer Private Messages also installed. I wanted to add a link in the info box if there is a message for the customer.

 

Here is the code that displays the alert, it is currently in the account.php

 

 

<?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'];

}

 

else {echo PRIVATE_MESSAGES_NO;}

?>

 

 

 

 

 

 

 

I want to add it in the login box here:

 

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT);

new infoBoxHeading($info_box_contents, true, true);

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' =>

'<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '', 'SSL') . '">' . LOGIN_BOX_PRODUCTS_NEW . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>');

new infoBox($info_box_contents);

?>

 

 

 

I added a define in english.php for PRIVATE_MESSAGES_YES. I just assume display nothing at all if there are not messages.

 

Thanks,

Todd

Link to comment
Share on other sites

  • 3 weeks later...

This is a great contrib. But I have a couple questions:

 

1. How does the customer reply to the private message? This seem like only a one-way communication.

2. what about between the staffs in the admin private message? This is also great when you have many staff working on the admin side.

Link to comment
Share on other sites

Custodian said he will release an updated version in due course, with many features in it.

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

Here is an example of code to place in for example loginbox. It will give you an idea.

It will only display if the customer has a private message.

 

 

Example Code: (not complete file)

 

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => '' . tep_loginbox_greet_top() . '<br>');

 

// BEGIN Private Message v1.3

$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'] != '') {

 

$info_box_contents[] = array('align' => 'left',

'text' => ' ' . tep_image(DIR_WS_IMAGES . 'icons/arrow_red.gif') . ' ' . '<a href="' .

tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_PRIVATE_MESSAGES_YES . '</a><br>');

}

// END Private Message v1.3

 

$info_box_contents[] = array('align' => 'left',

'text' => ' ' . tep_image(DIR_WS_IMAGES . 'icons/arrow_red.gif') . ' ' . '<a href="' .

tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .

 

 

And to answer the previous post ... No there is no way at this time to reply. It is only a message from Admin to the Customer to tell them something for example.

 

And yes it would be nice to modify it so that the customer can reply ... and the admin can read the reply etc. ... maybe I will try sometime to do it .. or someone else will.

Link to comment
Share on other sites

  • 4 months later...

hi,

i have the same problem of pixclinic , customer can't delete the private massage by clicking the delete button because it will redirect to the login page over and over again...

 

i think there is this problem because im using SSL , and is activated...

 

the problem still here in the /catalog/account.php

 

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

 

any solution please?

Link to comment
Share on other sites

someone can help me please? im using SSL and i think it the problem...

 

i asked to pixclinic how to fix this problem but he doesn't remember how to do...

Link to comment
Share on other sites

  • 2 months later...

I've just installed this into my catalog and really like it- the only problem (after using your logout fix) is that once I've deleted the message I then have to refresh to get the message to disappear. It's not a huge problem but I have this mental image of a customer clicking 'delete' over and over and over because they think it's not working. Oh! And when I visit the admin end of it I do have to actually click on 'edit' for a customer to add a message- is that how it's supposed to be done or did I screw something up?

 

As a feature, would it be possible to adapt your loginbox example as a text link? Since it only appears if there is a message it makes sense to me (since my customers are kicked back to the index rather than 'My Account' after they log in) to have it appear on the mainpage after the welcome message- something like 'Welcome back >customer<! You have a new private message from >website<- please click here to view it now.

Link to comment
Share on other sites

  • 2 months later...

Congratulations for this excellent contribution.

 

I have a small problem with it, though: the messages disappear after the first time they are read. When the customer logs in and hits "account.php", he sees the message. But then, even if he doesn't click on "delete message", the message is deleted. It will not reappear if the customers hits refresh or goes somewhere and comes back to "account.php". Is this the normal behavior of this contribution?

Link to comment
Share on other sites

  • 3 months later...

Hey, can someone tell me, how i do so the "Delete Message" will be a picture button, so it will mach the other one. ?

 

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

Link to comment
Share on other sites

  • 2 weeks later...
... 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

 

yes.. i agree with you... it would be a brilliant way to get customer return to the site. B)

"I am not a Newbie but I am not an Expert either..."
"Lets learn about osCommerce together!..."
Link to comment
Share on other sites

  • 3 weeks later...
Hey, can someone tell me, how i do so the "Delete Message" will be a picture button, so it will mach the other one. ?

 

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

 

 

Hi,

 

Did you ever find a solution to this? If so, would you mind sharing?

Or if someone with better skills than me could help me/us out with this one.

 

Thx in advance.

Link to comment
Share on other sites

  • 2 weeks later...

Is there a way to add "canned" messages to all? Sort of like an autoresponder?

 

Example:

 

Message 1 to display immediately after the sale. Something like "thank you...."

 

Message 2 to display 24 hours after the sale. "Your order is being processed..."

 

Message 3 to display in their inbox 3 days after the sale. "Your order is complete..."

 

Let me know how, or if its' a "customization" project - let me know if you are able to do this for me individually (and your rate/charge) - its' exactly what I've been searching for! :-)

 

Thanks again for this GREAT contribution!

Jesse

Link to comment
Share on other sites

  • 6 months later...

Hello,

 

I am wondering if I am missing something here. Pls accept my apologies in advance if I sound a bit ignorant.

 

When the customer creates a new account and makes a mistake in typing his email, he will need to use the same email and password to login the next time. When he tries to login, he will surely use the correct email and that will not be accepted as the registered email was different (a mistake) ....so how will he be able to login and see the private message ?

 

dca

Link to comment
Share on other sites

I am trying to add a delete image instead. I am new to PHP and not sure how to do it. I got the image to show up but it does not work. In the code below I put the orig. back in and left the code for the image. the orig. button works but the image does not.

 

also when you delete the message you have to refresh the page to get the message to go away.

 

 

 

<!-- 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 class="main" align="right" width="110"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') ; ?></td>

<td align="left">

 

<?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 '<form method="post">';

echo '<p><input type="submit" name="submit" value="Delete Message">';

echo tep_image_submit('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE);

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

 

Any help is appreciated

 

Mike

Link to comment
Share on other sites

I am trying to add a delete image instead. I am new to PHP and not sure how to do it. I got the image to show up but it does not work. In the code below I put the orig. back in and left the code for the image. the orig. button works but the image does not.

 

also when you delete the message you have to refresh the page to get the message to go away.

<!-- 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 class="main" align="right" width="110"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') ; ?></td>

<td align="left">

 

<?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 '<form method="post">';

echo '<p><input type="submit" name="submit" value="Delete Message">';

echo tep_image_submit('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE);

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

 

Any help is appreciated

 

Mike

 

hey i added some stuff to make it look nice and work proporliy

just look at the contribution page and change the submit button with your's echo tep_image_submit('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE);

 

that's all ( the message will go away when you press delete message ).

Link to comment
Share on other sites

did the above message and now all i get is a blank page.

 

Getting a parse error when I check it with Rapid pHP

around

 

echo "<tr><td class=" main ">" . PRIVATE_MESSAGES_DELETED . "</td></tr>";

 

Mike

Edited by paq1200
Link to comment
Share on other sites

did the above message and now all i get is a blank page.

 

Getting a parse error when I check it with Rapid pHP

around

 

echo "<tr><td class=" main ">" . PRIVATE_MESSAGES_DELETED . "</td></tr>";

 

Mike

 

 

I had to go through and change " to '

 

thanks

Link to comment
Share on other sites

i don't know what blue line you talking about.

 

but the table is written with the class " Infobox " you can get in the stylesheet.css at catalog/

 

and then look for .infobox , and change it there

:-)

hope this is helpful or just send me the code at account.php

Link to comment
Share on other sites

  • 2 months later...
Now that I have it the way I want it can you tell me how to get the thin blue border around it?

 

Just like the My orders table and my account.

 

Thanks so much for the help

Mike

 

 

Here:

 

1............

 

<!-- BEGIN Private Message v1.0 -->

<tr>

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

<tr>

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

</tr>

</table></td>

</tr>

<tr>

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

<tr class="infoBoxContents">

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

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'private_message.gif'); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

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

<tr>

<td class="main">

<?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 '<form 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></td>

<td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table>

<!-- END Private Messages -->

 

 

2...............

 

make a file "private_message.gif" and put him in "catalog/images"

Link to comment
Share on other sites

  • 1 month later...

Hi there!

 

I find this contribution very useful. I got a little problem though and cannot find where is the problem: After I installed CPV, when I go as admin to the customer details, the DOB doesn't show, it just appears the field empty. the same happens if the customer goes to change his/her account details, the DOB doesn't show. Before installung CPV it was showing ok... Anyone can assist me on this? Thanks for any help (probably is something obvious isn't it :rolleyes: )

Link to comment
Share on other sites

We have installed the mod and we have sent a message to the user and then logged into the user account and we havent recieved the message , What could be causing these issues

Edited by lilangel
Link to comment
Share on other sites

  • 4 months later...

great contrib but i have run into this problem???

 

 

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 'fromcustomers c left join address_book a on c.customers_id = a.customers_id and ' at line 1

 

select count(*) as total fromcustomers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id

 

any ideas???

 

i did miss the from as per a previous post but i fixed that issue and got hit with this one...

 

need help please

 

in the admin/customers.php

Thanks in advance!

 

Ben

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