Zen Cart Logo
Forums / Managing Customers and Orders / Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Views: 4,012

Results 1 to 18 of 18
10 Jun 2007, 4:04 PM
#1
apemusic avatar

apemusic

Zen Follower

Join Date:
May 2006
Posts:
134
Plugin Contributions:
0

Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Hi there,

I use Marg’s code where I tick a box to insert my a few comments such as
“Hi there, your item has been shipped, see tracking number”
http://www.zen-cart.com/forum/showthread.php?t=29578&highlight=order+marg

But so it does not look like an auto comment and more personal is there any thing I can put to automatically insert the customers FIRST NAME? I have tried a few things but none of them work. I use this code on my orders.php page and tracker.php page

Currently for every customer I change “Hi there” to “Hi John” or “Hi Jane” etc. manually for each order.

But I want to save time and have this appear manually? How do I do it pls??

10 Jun 2007, 6:28 PM
#2
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Try adding this code to your pages you want changed:

define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>!');

11 Jun 2007, 4:08 AM
#3
apemusic avatar

apemusic

Zen Follower

Join Date:
May 2006
Posts:
134
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Thanks Get Em Fast,

Thanks for trying to help but I cannot get it to work, what exactly do you mean??

I inserted this code both above the <head> and then above the </head> tags and it just displayed at the top of the orders page when I viewed it.
define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>!');

Then later on in my message to the customer instead of 'hi there your order has been shipped' I put 'TEXT_GREETING_PERSONAL your order order been shipped' but it does not display the customer name all it displays is TEXT_GREETING_PERSONAL?
Am I supposed to put some insert function?? Also where do I insert that define exactly?
I am doing this with the admin/orders.php file??

11 Jun 2007, 2:08 PM
#4
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

apemusic, I'm not exactly sure, since I don't use this code (yet), but you might ask Marg about this.

12 Jun 2007, 10:58 AM
#5
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

To call the customer's first name you would add this code above the code for the comments in the admin/orders.php:

<?php $get_name = $db->Execute("select customers_firstname from " . TABLE_CUSTOMERS . " where customers_id = '" . $order->customer['id'] . "'"); ?>

Then call the name with:

<?php echo $get_name->fields['customers_firstname']; ?>

Marg

14 Jun 2007, 12:44 PM
#6
apemusic avatar

apemusic

Zen Follower

Join Date:
May 2006
Posts:
134
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

awesome, it works!!

thanks marg you are a champ!

this is saving me heaps of time now ;)

cheers,
Dave

14 Jun 2007, 1:56 PM
#7
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Glad I could help. I know it saves me tons of typing! I'm working on a declined credit card piece with a link to re-submit credit card details... I'll post this once it's perfected! Same situation, check checkbox for instant comment.
Marg

9 Sep 2007, 12:24 PM
#8
apemusic avatar

apemusic

Zen Follower

Join Date:
May 2006
Posts:
134
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Hi Marg,

Your contrib has been helping me heaps, awesome work and thanks again!!!

however I still have to click into each order in order to update status and tick that box, so the next step ...

Do you know how if I log into PDFOC or Super Orders and say update 10 orders in one go, from say processing to update and send a "your order is being shipped" message, how can I send a standard comment to each of them and make it GREET EACH CUSTOMER WITH THEIR NAME. e.g. same message, inserts customers name each time. Hi John, Hi Mary etc. ??

11 Sep 2007, 5:38 PM
#9
apemusic avatar

apemusic

Zen Follower

Join Date:
May 2006
Posts:
134
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

I want to be able to tick a box and give the customer a link to their invoice, basically in order to to that I need to be able to insert ORDER NUMBER, I suppose it is very similar to the code you gave me to insert FIRST NAME, any idea:

To call the customer's first name you would add this code above the code for the comments in the admin/orders.php:

<?php $get_name = $db->Execute("select customers_firstname from " . TABLE_CUSTOMERS . " where customers_id = '" . $order->customer['id'] . "'"); ?>

Then call the name with:

<?php echo $get_name->fields['customers_firstname']; ?>

something like this I presume but how do I change it for ORDER NUMBER??

24 Mar 2010, 5:29 AM
#10
pinkcolour avatar

pinkcolour

New Zenner

Join Date:
Feb 2010
Posts:
10
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

apemusic:

Hi there,

I use Marg’s code where I tick a box to insert my a few comments such as
“Hi there, your item has been shipped, see tracking number”
http://www.zen-cart.com/forum/showthread.php?t=29578&highlight=order+marg

But so it does not look like an auto comment and more personal is there any thing I can put to automatically insert the customers FIRST NAME? I have tried a few things but none of them work. I use this code on my orders.php page and tracker.php page

Currently for every customer I change “Hi there” to “Hi John” or “Hi Jane” etc. manually for each order.

But I want to save time and have this appear manually? How do I do it pls??

Hi, where can I find Marg's insert comment code? I have clicked on the link you posted but it says I do not have permission to view that page. Thanks!

24 Mar 2010, 8:01 AM
#11
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Hi Pink - I'll see if I can find it...
Marg

24 Mar 2010, 9:33 AM
#12
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

http://www.marg-art.com/orders.zip

Back up your admin/orders.php
Replace with the above file.

Lines 557-590 to change text.

If you have questions, ask...

24 Mar 2010, 9:00 PM
#13
pinkcolour avatar

pinkcolour

New Zenner

Join Date:
Feb 2010
Posts:
10
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Thank you very much Sir!

24 Mar 2010, 9:40 PM
#14
pinkcolour avatar

pinkcolour

New Zenner

Join Date:
Feb 2010
Posts:
10
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

So I downloaded the orders.php and I replaced it with my admin/orders.php (after I backed up my original one), and then I uploaded it via FTP. Then I logged into my zen cart, click on customers > orders and then I choose a random customer and scrolled down to where it says "comments/ status" but I do not see anything different than before I replaced the orders.php. I assume that I should be seeing a section where I can "tick" off the comments for the text on lines 557-590? - But I do not see it. Please advise. Thanks in advance!

24 Mar 2010, 9:47 PM
#15
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

You must not have uploaded it to the right folder - There's no reason for it not to show. I don't have any if/else statements.

24 Mar 2010, 9:53 PM
#16
pinkcolour avatar

pinkcolour

New Zenner

Join Date:
Feb 2010
Posts:
10
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Hi Marg.

I am very sorry for my mistake! I did uploaded it to the wrong folder!

I had uploaded it to the admin/orders.php instead of pinkcon/admin/orders.php

It works perfect now. I am embarrassed that I did not check to see if I had uploaded it in the correct folder. Thank you very much for your help!

24 Mar 2010, 9:54 PM
#17
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Sure - anytime...

14 Jan 2011, 2:21 AM
#18
gruntre69 avatar

gruntre69

Zen Follower

Join Date:
Aug 2005
Location:
Australia
Posts:
103
Plugin Contributions:
0

Re: Marg’s insert comment code, how do I make it say "Dear CUSTOMER_NAME?"

Thanks sooooo much for this contribution, it should be standard in Zen cart for sure. It would be even better if there was an easy way to have the comment auto select when the status is chosen from the status drop down list. It great anyway, it save hours of typing and is much better to the customer...... Cheers Marg!