X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Customer notes in email (https://forum.x-cart.com/showthread.php?t=6837)

oziris 03-24-2004 09:49 AM

Customer notes in email
 
How do I get customer notes from the order to show up in emails?

Thanks,
Predrag

B00MER 03-29-2004 02:04 PM

In skin1/mail/order_data.tpl you can try to use the following:
Code:

{$order.Customer_Notes}

Risky 04-13-2004 07:54 AM

Boomer ... I have the same requirement and tried your suggestion, but it didn't seem to work. Here's my full code:

Code:

{if $order.Customer_Notes}
Order Notes:
-------------
{$order.Customer_Notes}

{/if}


I feel damn stupid asking this, because this should be simple enough.

Can you see anything wrong? Is the field name definitely correct? Is the field name case sensitive (though I also tried with all lower case, with no better result)?

Very grateful!

oziris 04-13-2004 08:04 AM

It didn't work for me either. I don't see why this would not come in email by default anyway.

Predrag

B00MER 04-13-2004 08:37 AM

Have you tried {$Customer_Notes} instead of {$order.Customer_Notes} ?

If that doesn't work somewhere in the php the value needs to be set, maybe in include/func.php, func_order_data(); :?

let me know.

Risky 04-13-2004 10:42 AM

I have really tried on this one .. $Customer_Notes didn't work, so I went looking into include/func.php.

This is the first time ever that I have been in to X-cart by other than the admin area ... the only relevant reference I could find was to "$order["notes"]", so I tried "$order.notes" .. but still without any success.

I tried looking closely in func.php, but couldn't see anything else of possible relevance, and it was far too late to look elsewhere (1:40am now).

If you have any more suggestions, I'd be real grateful. I may look again tomorrow.

Thanks again

B00MER 04-13-2004 12:15 PM

Looking over include/payment_method.php I see:
Code:

$userinfo = array_merge($userinfo,$HTTP_POST_VARS);

So this may work:

{$userinfo.Customer_Notes}

If not try adding

Code:

$mail_smarty->assign("Customer_Notes",$HTTP_POST_VARS["Customer_Notes"]);

To the payment_method.php file. and try $Customer_Notes again in the mail template.

hth. ;)

Risky 04-15-2004 12:42 AM

Boomer .. Sorry, no luck with either of these two suggestions.

{$userinfo.Customer_Notes} didn't produce anything.

The second suggestion produced an error on running:

Quote:

Fatal error: Call to a member function on a non-object in /home/gowest/public_html/store/include/payment_method.php on line 39

Line 39 was the new code I added. The first few lines of payment_method.php looked like this (with new line inserted just after the opening comment lines):

Code:

#
# $Id: payment_method.php,v 1.27 2003/10/13 06:36:36 svowl Exp $
#
# CC processing payment module
#

$mail_smarty->assign("Customer_Notes",$HTTP_POST_VARS["Customer_Notes"]);

include_once "../top.inc.php";
include_once $xcart_dir.DIR_CUSTOMER."/auth.php";

x_session_register("cart");
x_session_register("order_secureid");
x_session_register("ship_to");
x_session_register("extended_userinfo");

if (@$HTTP_POST_VARS["action"] == "place_order" and !empty($cart)) {
#
# Check if products in cart is in stock yet
#


In case there's any confusion here, I am trying to get the contents of Customer Notes field included in the Invoice displayed to customer at the end of his checkout, plus also on the emailed order confirmation message sent to him.

The order notification sent to admin already shows the Customer Notes under the heading "Credit Card Information" or something similar.

I don't want to bog you down in something as relatively minor as what I am trying to do, so unless you can see something wrong in what I have done above, or have another quick suggestion to try, I'll probably drop this for now and include the requirement in a list of mods I'll ask the x-cart people to quote me on later.

If I was actually a programmer or knew more about what I was doing, I would perservere. I just figured this would be relatively simple, but looks like it's not.

Cheers and thanks,

caucus 04-15-2004 07:03 AM

Hello

I agree with you X-cart has this stupid idea that the sales department or the customre is not supposed to see the notes. It appears the customer notes also holds the CC info.

X-cart should fix this problem. However, in the mean time I had X-cart do a mod for the site and it does work. I use 2CO at checkout and the CC info is not in the comments.

Instead of having a sepearted field for the CC info they are using the comments for this information.

In my view there should be customer notes and then have a field for CC info.

They took a shortcut that is not satisfactory!

oziris 04-23-2004 01:17 PM

It looks as if this got worked on in the latest patch 3.5.7. I hope it works.

Predrag

Risky 04-24-2004 06:11 AM

Oziris .. . This is good news if it is in 3.5.7. But, how do you know what's in 3.5.7? It's not even showing on the X-Cart website yet, the latest there being 3.5.6.

Thanks for the news anyway.

oziris 04-24-2004 07:14 AM

http://forum.x-cart.com/viewtopic.php?t=9883

Risky 04-24-2004 11:26 PM

Beauty, thanks.

caucus 04-25-2004 03:56 AM

Hello Group

I looked at http://forum.x-cart.com/viewtopic.php?t=9883 and did not see anything mentioned about customer notes being sent with the e-mail.

There is a mention of orders but not customer notes. Are customer notes being passed in the e-mail?

Loon 05-11-2004 07:25 AM

If you are still struggling with the 'customer notes' problem, they are stored, encryped, along with the credit card info in the database. Here is a solution that worked to print them in other places -- probably could easily pick this added variable up for the email as well. Hope that helps.

http://forum.x-cart.com/viewtopic.php?t=9400

caucus 05-11-2004 09:28 AM

Hello Loon

Thanks for the link. I will check it out ASAP!

instinctual 05-26-2004 08:46 AM

Customer Notes in Export
 
HI all, wanted to offer a little help - since X-Cart selfishly lumps all of the CC info and customer notes together, you have to extract them one by one if you JUST want one piece of info.

Here is the syntax for a tag that just pulls the customer notes, not the cc info, into my export file - - hope it sheds some light.

{$orders[oid].details|replace:"\n":" "|regex_replace:"/^.*Customer notes: (\w+).*$/":"\\1"}

OR, if you just want to pull the expiration date of the card for example:

{$orders[oid].details|replace:"\n":" "|regex_replace:"/^.*Exp. date: (\d+).*$/":"\\1"}

Happy hunting :O)

amy2203 12-15-2004 02:28 AM

This did not work for me:

{$orders[oid].details|replace:"\n":" "|regex_replace:"/^.*Customer notes: (\w+).*$/":"\\1"}

so I changed it to:

{$order.details|replace:"\n":" "|regex_replace:"/^.*Customer notes: (\w+).*$/":"\\1"}

Which works but I only get the first word of the customer notes. It is stripping out everything after the first space. I don't understand exactly how this line of code works, I'm trying to work it out from the Smarty site, but if anyone can see the problem, it would be most appreciated.

Thanks

Amy

amy2203 12-15-2004 05:23 AM

OK, I'm not sure why this works but it does:

{$order.details|replace:"\n":""|regex_replace:"/^.*Customer notes:/":" "|regex_replace:"/--- Advanced info.*/":""}

From what I can make out it is replacing everything up to the end of "Customer notes:" with nothing (ie removing it) and the same with everything starting "---Advanced info" leaving Just the actual notes. I'm putting this into my invoice template so when the invoice is printed (also used as a picking list) the notes are there.

Hope this helps someone,

Amy


All times are GMT -8. The time now is 10:32 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.