Skip to content

Instantly share code, notes, and snippets.

@joebrislin
Created October 17, 2012 16:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joebrislin/3906534 to your computer and use it in GitHub Desktop.
Save joebrislin/3906534 to your computer and use it in GitHub Desktop.
Slatwall: Updated Delivery Confirmation utilizing orderFulfillment entity
if ( not StructKeyExists(request.context, '$') ) {
request.context.$ = application.serviceFactory.getBean('muraScope');
if ( StructKeyExists(session, 'siteid') ) {
request.context.$.init(session.siteid);
} else {
request.context.$.init('default');
};
};
<!---
Slatwall - An Open Source eCommerce Platform
Copyright (C) 2011 ten24, LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
Notes:
--->
<cfparam name="orderFulfillment" type="any" />
<cfscript>
local = {};
local.order = orderFulfillment.getOrder();
local.orderDelivery = local.order.getOrderDeliveries()[local.order.getOrderDeliveries().size()]; // retrieve latest delivery to be emailed
</cfscript>
<cfoutput>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<style type="text/css">
@media only screen and (max-device-width: 480px) {
table[class=outer] .cut {
width: 0 !important;
padding: 0 !important;
}
table[class=outer] .vcut {
height: 0 !important;
padding: 0 !important;
}
table[class=outer] img.cut {
display: none !important;
width: 0 !important;
height: 0 !important;
}
table[class=outer] .cut span, table[class=outer] .cut a {
display: none !important;
}
table[class=outer] .frame {
width: 320px !important;
}
table[class=outer] .main_header.media_header {
width: 300px !important;
height: 55px !important;
}
table[class=outer] .header_left {
height: 55px !important;
}
table[class=outer] .logo_header {
height: 62px !important;
}
table[class=outer] .media_header .main_name {
font-size: 12px !important;
line-height: 14px !important;
}
table[class=outer] .media_header .subtitle {
font-size: 12px !important;
}
table[class=outer] .media_main {
width: 300px !important;
}
table[class=outer] .media_main .intro {
width: 260px !important;
font-size: 14px !important;
}
table[class=outer] .media_main .intro2 {
font-size: 14px !important;
}
table[class=outer] .media_main .suggestions {
font-size: 14px !important;
}
table[class=outer] .media_more {
width: 300px !important;
border-radius: 0 !important;
background-color: ##ffffff !important;
border-top: 1px solid ##e8e8e8 !important;
}
table[class=outer] .media_button {
width: 300px !important;
background-color: ##209ae4 !important;
padding-top: 3px !important;
padding-bottom: 3px !important;
}
table[class=outer] .media_footer {
font-size: 11px !important;
line-height: 14px !important;
padding: 0 10px !important;
}
table[class=outer] .address {
font-size: 11px !important;
line-height: 14px !important;
display: block !important;
}
table[class=outer] td[class=footer-padding-top] {
height: 20px !important;
}
table[class=outer] td[class=footer-padding-bottom] {
height: 17px !important;
}
table[class=outer] .media_footer br {
display: none !important;
}
table[class=outer] .reset {
display: block !important;
padding-bottom: 4px !important;
}
table[class=employee-only-padding-top-bottom] {
width: 310px !important;
}
td[class=employee-only-padding-left-right] {
width: 4px !important;
}
table[class=employee-only] {
width: 310px !important;
}
}
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
table[class=outer] .media_button {
padding-top: 3px !important;
padding-bottom: 3px !important;
background-color: ##209ae4 !important;
}
table[class=outer] .media_button td.cut {
width: 0 !important;
padding: 0 !important;
}
table[class=outer] .media_button {
padding-left: 10px !important;
padding-right: 10px !important;
}
}
a:link, a:visited {
color:##080;
}
h2 {
font-size: 17px;
}
</style>
</head>
<body style="margin: 0; padding: 0; background-color: ##dddddd;">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="outer" style="position: relative; background-color: ##dddddd;">
<tbody>
<tr>
<td>
<table class="outer frame" align="center" cellpadding="0" cellspacing="0" border="0" width="100%" style="border: 0px; border-left: 1px solid ##cccccc; border-right: 1px solid ##cccccc; background-color: ##eeeeee;position: relative;">
<tbody>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="header frame" style="background-color: ##005500;">
<tbody>
<tr>
<td class="header_left cut" style="width: 75px; height: 37px;"></td>
<td class="col header cut" style="width: 25px;background-color: ##005500;"></td>
</tr>
<tr>
<td class="main header_drop cut" height="17" colspan="4" style="border-top: 1px solid ##dddddd;background-color: ##eeeeee;">&nbsp;</td>
</tr>
</tbody>
</table> </td>
<td rowspan="3"></td>
</tr>
<tr>
<td>
<center>
<table width="600" border="0" cellpadding="0" cellspacing="0" class="main frame"><tbody>
<tr><td class="main_avatar cut" width="197" style="text-align: right; padding-right: 10px;"> <a href="http://<cfoutput>#$.siteConfig('domain')#</cfoutput>" style="border: none; color: ##0084b4; text-decoration: none; float: left;margin-left:30px;padding-bottom:5px;"><img class="cut" src="http://<cfoutput>#$.siteConfig('domain')#</cfoutput>/tractorsbigandsmall/includes/themes/tbs/images/email/tbs_logo.png?20120411095133" width="150" alt="Tractors Big and Small" style="border-radius: 4px;border: 0;" /></a> </td>
<td class="main_avatar cut" width="197" style="text-align: right; padding-right: 10px;">
<a href="http://<cfoutput>#$.siteConfig('domain')#</cfoutput>" class="address" style="border: none; color: ##0084b4; text-decoration: none;font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; text-decoration: none; font-size: 11px; line-height: 17px; color: ##666666; text-shadow: 0 1px 0 ##ffffff;float:right;clear:right;"><span class="nobreak" style="white-space: nowrap;float:right;clear:right;">Tractors Big &amp; Small</span><span class="nobreak" style="white-space: nowrap;float:right;clear:right;">#$.siteConfig('contactAddress')#</span><span class="nobreak" style="white-space: nowrap;float:right;clear:right;">#$.siteConfig('contactCity')#<cfif len( trim( $.siteConfig('contactCity') ) ) gt 0 and len( trim( $.siteConfig('contactState') ) ) gt 0>,</cfif> #$.siteConfig('contactState')# #$.siteConfig('contactZip')# </span><span class="nobreak" style="white-space: nowrap;float:right;clear:right;">Phone: #$.siteConfig('contactPhone')#</span></a>
</td></tr>
</tbody>
</table>
</center>
<center><table width="600" border="0" cellpadding="0" cellspacing="0" class="main frame" style="background-color: ##ffffff;margin-bottom:20px;border: 1px gray solid;border-radius:5px;">
<tbody>
<tr>
<td class="col cut" style="width: 75px;"></td>
<td class="media_main">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<!-- <tr style="float:left;margin-left:-100px;padding-top:10px;">
<td class="main_avatar cut" width="197" style="text-align: right; padding-right: 10px;"> <a href="[:SERVER:]" style="border: none; color: ##0084b4; text-decoration: none;"><img class="cut" src="../img/tbs_logo.png?20120411095133" width="120" height="62" alt="Tractors Big and Small" style="border-radius: 4px;border: 0;" /></a> </td>
</tr> -->
<tr>
<td width="371" height="77" class="main_header media_header" style="padding-left: 10px; padding-right: 10px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: ##333333;"> <span class="main_name" style="font-size: 20px; line-height: 16px; font-weight: bold; color: ##000000;">Delivery Confirmation</span> </td>
</tr>
<tr>
<td class="mid text" style="padding: 10px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: ##333333;padding-bottom: 0; font-size: 15px; line-height: 20px;">
<p>Good news! Your order has been fulfilled and shipped. You can track the progress of your shipment by clicking the tracking number on the link below.</p>
<cfoutput>
<h2>Order Information</h2>
<table id="orderInfo" style="border-spacing: 0px; border-collapse: collapse; border: 1px solid ##d8d8d8; text-align: left; font-size: 12px; width: 350px;">
<tbody>
<tr>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;"><strong>Order Number:</strong></td>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;"> #local.order.getOrderNumber()#</td>
</tr>
<tr>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;"><strong>Order Placed:</strong></td>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;"> #DateFormat(local.order.getOrderOpenDateTime(), "DD/MM/YYYY")# - #TimeFormat(local.order.getOrderOpenDateTime(), "short")#</td>
</tr>
<tr>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;"><strong>Customer:</strong></td>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;"> #local.order.getAccount().getFullName()#</td>
</tr>
<cfif !isNull(local.orderDelivery.getTrackingNumber()) && len(local.orderDelivery.getTrackingNumber())>
<tr>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;"><strong>Tracking Number:</strong></td>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;">
<cfif findNoCase('ups', local.orderDelivery.getShippingMethod().getShippingMethodName())>
<a href="http://wwwapps.ups.com/WebTracking/track?track=yes&amp;trackNums=#local.orderDelivery.getTrackingNumber()#">
#local.orderDelivery.getTrackingNumber()#
</a>
<cfelseif findNoCase('fedex', local.orderDelivery.getShippingMethod().getShippingMethodName())>
<a href="http://www.fedex.com/Tracking?action=track&tracknumbers=#local.orderDelivery.getTrackingNumber()#">
#local.orderDelivery.getTrackingNumber()#
</a>
<cfelse>
#local.orderDelivery.getTrackingNumber()#
</cfif>
</td>
</tr>
</cfif>
</tbody>
</table>
<h2>Items Shipped</h2>
<table id="styles" style="border-spacing: 0px; border-collapse: collapse; border: 1px solid ##d8d8d8; text-align: left; font-size: 12px; width:600px;">
<thead>
<tr>
<th style="background: ##f9f9f9; border: 1px solid ##d8d8d8; padding: 0px 5px;">Sku Code</th>
<th style="background: ##f9f9f9; border: 1px solid ##d8d8d8; padding: 0px 5px;">Product</th>
<th style="background: ##f9f9f9; border: 1px solid ##d8d8d8; padding: 0px 5px;">Options</th>
<th style="background: ##f9f9f9; border: 1px solid ##d8d8d8; padding: 0px 5px;">Qty</th>
</tr>
</thead>
<tbody>
<cfloop array="#local.orderDelivery.getOrderDeliveryItems()#" index="_deliveryItem">
<tr>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;">#_deliveryItem.getOrderItem().getSku().getSkuCode()#</td>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;">#_deliveryItem.getOrderItem().getSku().getProduct().getTitle()#</td>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;"><cfif len(_deliveryItem.getOrderItem().getSku().displayOptions())>#_deliveryItem.getOrderItem().getSku().displayOptions()#</cfif></td>
<td style="border: 1px solid ##d8d8d8; padding:0px 5px;">#NumberFormat(_deliveryItem.getQuantity())# </td>
</tr>
</cfloop>
</tbody>
</table>
</cfoutput>
<p>We are dedicated to delivering the best shopping experience possible. If you have any questions, please reply to this email and let us know how we can help.</p>
</td>
</tr>
<tr>
<td height="20"> </td>
</tr>
<tr>
<td class="mid text" style="padding: 10px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: ##333333;padding-bottom: 0; font-size: 15px; line-height: 20px;">Thanks for choosing us, </td>
</tr>
<tr>
<td height="10"> </td>
</tr>
<tr>
<td class="mid text" style="padding: 10px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: ##333333;padding-bottom: 0; font-size: 15px; line-height: 20px;">
Your <a href="http://TractorsBigandSmall.com">TractorsBigandSmall.com</a> Customer Service Team
<br/><a href="mailto:#$.siteConfig('contactEmail')#">#$.siteConfig('contactEmail')#</a>
</td>
</tr>
<tr>
<td height="20"> </td>
</tr>
</tbody>
</table> </td>
<td class="col cut" style="width: 75px;"></td>
</tr>
</tbody>
</table></center> </td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="frame footer" style="background-color: ##222222;">
<tbody>
<tr>
<td colspan="3" height="18" class="footer-padding-top" style="border-top: 1px solid ##dddddd;"></td>
</tr>
<tr>
<td class="col cut" style="width: 75px;"></td>
<td class="footer_body media_footer" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17px; color: ##bbbbbb; text-shadow: 0 1px 0 ##000000;width: 570px;padding-right:30px;">
<div class="reset" style="padding-top:15px;">
This email was sent to you by TractorBigandSmall.com. To ensure delivery to your inbox (not bulk or junk folders), you can add orders@tractorsbigandsmall.com<mailto:orders@tractorsbigandsmall.com> to your address book or safe list.
</div>
<div style="width: 100%; float:right;padding-top:15px;text-align:right;">
<a href="http://www.blueridgeinteractive.com" style="border: none; color: ##bbbbbb; text-decoration: none;line-height:18px;">Website Development by <img class="cut" src="http://<cfoutput>#$.siteConfig('domain')#</cfoutput>/tractorsbigandsmall/includes/themes/tbs/images/email/blueRidge_logo.png" width="116" height="32" alt="Website Development by BlueRidge Interactive" style="border-radius: 4px;border: 0;vertical-align:middle;" /></a>
</div>
</td>
<td class="col cut" style="width: 25px;"></td>
</tr>
<tr>
<td colspan="3" class="footer-padding-bottom" height="25"></td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table>
</body>
</html>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment