Show OrderNote in order confirmation Email?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
pbhavsar
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Wed Jun 25, 2008 12:21 pm

Show OrderNote in order confirmation Email?

Post by pbhavsar » Tue Nov 11, 2008 2:59 pm

Hello,

I am wondering whether OrderNote info can be displayed in the order confirmation Email? Does anybody know which object/file is responsible for sending order confirmation emails?

Thanks.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Show OrderNote in order confirmation Email?

Post by jmestep » Tue Nov 11, 2008 3:20 pm

You would have to see if you can add it to the Order confirmation email template which is located at Configure-->Email-->Templates. You can probably get the code from the Note added by Customer template which can be generated when there is an order note added. It would be something like this, but you would probably need to put code on it to get the first note added.
On ${note.CreatedDate}, a new message&nbsp;was added to <a href="${store.StoreUrl}Admin/Orders/OrderHistory.aspx?OrderId=$order.OrderId">Order Number $order.OrderId</a></strong></p>
<p><strong>Customer said:</strong></p>
<p>${note.Comment}</p>
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

pbhavsar
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Wed Jun 25, 2008 12:21 pm

Re: Show OrderNote in order confirmation Email?

Post by pbhavsar » Thu Nov 13, 2008 3:12 pm

jmestep wrote:You would have to see if you can add it to the Order confirmation email template which is located at Configure-->Email-->Templates. You can probably get the code from the Note added by Customer template which can be generated when there is an order note added. It would be something like this, but you would probably need to put code on it to get the first note added.
On ${note.CreatedDate}, a new message&nbsp;was added to <a href="${store.StoreUrl}Admin/Orders/OrderHistory.aspx?OrderId=$order.OrderId">Order Number $order.OrderId</a></strong></p>
<p><strong>Customer said:</strong></p>
<p>${note.Comment}</p>
Thank you for the advice.

I agree with you. However, I am having trouble locating which file I shall put my code in. Would you shine some more light on me please ? Thanks!

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Show OrderNote in order confirmation Email?

Post by jmestep » Thu Nov 13, 2008 6:17 pm

Is this note something a customer does in the checkout process and they are not using the one for the shipping message?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Re: Show OrderNote in order confirmation Email?

Post by keats76 » Fri Nov 14, 2008 7:45 am

Something like this would probably work:

#foreach($note in $order.Notes)
$note.Comment <br/>
#end

I think the $order object is available to most nVelocity templates. Give it a shot and see if it works.

the note object is of type OrderNote if you want to look it up in the API.

pbhavsar
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Wed Jun 25, 2008 12:21 pm

Re: Show OrderNote in order confirmation Email?

Post by pbhavsar » Fri Nov 14, 2008 2:37 pm

What I am trying to do is to store "Delivery Date" and "Delivery Time" in the order. OrderNote may not be the desirable place to store the information. (I could not get it to work anyways ... :( ) I have decided to record the date and time in Shipment.ShipMessage. However, I still could not display the information in the "Order Confirmation Email".

My Code:
#foreach($shipment in $order.Shipments)
$shipment.ShipMessage.ToString()
#end

The data has been saved in the database, in OrderShipments.ShipMessage. But it shows an empty string in the email. Would anybody please point me out where I am doing wrong? Thank you!
Last edited by pbhavsar on Fri Nov 14, 2008 3:13 pm, edited 1 time in total.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Show OrderNote in order confirmation Email?

Post by AbleMods » Fri Nov 14, 2008 3:00 pm

pbhavsar wrote:My Code:
#foreach($shipment in $order.Shipments)
$shipment_date.ShipMessage.ToString()
#end
Based on your code, I think you would want to do:

Code: Select all

$shipment.ShipMessage
There's no need for the "_date" since you've referenced it as $shipment not $shipment_date.

the ToString is unnecessary since the value is already a string.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

pbhavsar
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Wed Jun 25, 2008 12:21 pm

Re: Show OrderNote in order confirmation Email?

Post by pbhavsar » Fri Nov 14, 2008 3:17 pm

Hi Joe Payne,

Sorry about that, it was a typo in my post. I have corrected it.

However, the problem remains.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Show OrderNote in order confirmation Email?

Post by mazhar » Sat Nov 15, 2008 6:08 am

#foreach($note in $order.Notes)
$note.Comment <br/>
#end
First of all this code will not work and will not send any thing because Email is sent when order is placed and actually at that time there is no order note available at all. The correct way is as described by Joe. The ShipMessage is infact the delevery instruction available with shipping. In order to make it available on OnePageCheckout first set the EnableShipMessage property the OnePageCheckout by setting it to true. Then use the following code in your OrderConfirmation Email tempalte.

Code: Select all

#foreach($shipment in $order.Shipments)
$shipment.ShipMessage
#end

Post Reply