Hi guys! Hope you're doing great! I hope i can get...
# advancedpdf
b
Hi guys! Hope you're doing great! I hope i can get help with the following... In NS we have an email template that is sent when an order is placed. That template is sent to the customer that contains the order details (subtotal, discounts, shipping, handling, total) and the items ordered of course. I need to combine the shipping and handling into one line, how can i do that? I think there should be a script that returns those values to the email template but seems that it is NS out of the box functionality. In the email template i see the shipping cost line as: ${salesorder.shippingCost} and the handling cost as ${salesorder.handlingCost}. Where can i modify/add a line that sums up both amounts? Hope this made sense. Thank you!!!
d
Hi, you can use #assign to add the
salesorder.shippingCost
and
salesorder.handlingCost
together
🙌 1
Does your current template have something similar to the below (after the item
#list
):
Copy code
<#if record.shippingcost gt 0>
	<tr>
		<td>Shipping</td>
		<td>${record.shippingcost}</td>
	</tr>
</#if>
<#if record.handlingcost gt 0>
	<tr>
		<td>Handling</td>
		<td>${record.handlingcost}</td>
	</tr>
</#if>
you would change it to something like:
Copy code
<#if record.shippingcost gt 0 || record.handlingcost gt 0>
	<tr>
		<td>Shipping & Handling</td>
		<td>${record.shippingcost + record.handlingcost}</td>
	</tr>
</#if>
(you don't actually have to use
#assign
, you can just add the two values ad-hoc)
🙌 1
b
Thank you so much!!!
I really appreciate your help. I am sorry to bug you more but i have one more question, where can i find more info about this? I have a bigger project that involves changing templates that are sent when an order is placed in NetSuite, not a web order. The form is customized so we pick which email template we want to send and then it seems that NS runs a script (which i can not find yet) to get the data and pass it to the email template. The image is just a piece of the email template with variables.
s
Those tags, <NLMESSAGE> and <NLAGING>, look like the tags use by the old templates (non-Advanced)
b
Hi Scott. Any idea how to get to that script that controls that non-advanced templates?
Btw, thank you for answering! 🙂
s
I actually don’t know how, or even if it’s possible, to script those older templates. Sorry. I imagine that the N/render module still uses those templates when printing a transaction, so long as they are the preferred template.
🙏 1
if you already have the HTML content, you could probably just re-implement them as advanced templates with a reasonable amount of effort.
b
I see, thank you so much!!!
I really appreciate your help!