Skip to content

Commit 857f1a2

Browse files
committed
fix(neworder): testing if there is a financial_status
1 parent ed43af6 commit 857f1a2

File tree

1 file changed

+45
-5
lines changed

1 file changed

+45
-5
lines changed

views/new_order.ejs

+45-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<a href="<% if (store.homepage) { %> <%= store.homepage %> <% } else{ %> https://<%= store.domain %> <% } %>"><img class="max-width" border="0" style="display:block;color:#000000;text-decoration:none;font-family:Helvetica, arial, sans-serif;font-size:16px;max-width:100% !important;width:100%;height:auto !important;" src="<%= store.logo.url %>" alt="" width="200"></a>
4545
</td></tr></tbody></table></td></tr></tbody></table>
4646
47-
<% if ( order.financial_status.current == 'unauthorized' || order.financial_status.current == 'voided') { %>
47+
<% if (order && order.financial_status && order.financial_status.current) { if ( order.financial_status.current == 'unauthorized' || order.financial_status.current == 'voided') { %>
4848
4949
<table class="module" style="padding:0px 10px 30px 10px;" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;">
5050
<tbody><tr>
@@ -208,7 +208,49 @@
208208
209209
<% } %>
210210
<% } %>
211+
<% } %>
212+
<% } else { %>
211213
214+
<table class="module" style="padding:0px 10px 30px 10px;" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;">
215+
<tbody><tr>
216+
<td style="padding:25px 20px 0px 20px;line-height:20px;text-align:center;" height="100%" valign="top" bgcolor="">
217+
<h2><span style="color:#333333;"><%= i18n.hello %> <%= customer.name.given_name %>, <%= i18n.new_order_title %></span></h2>
218+
</td>
219+
</tr>
220+
</tbody>
221+
</table>
222+
223+
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;">
224+
<tbody><tr>
225+
<td style="padding:10px 50px 10px 50px;line-height:22px;text-align:inherit;" height="100%" valign="top" bgcolor="">
226+
<div style="text-align: center;">
227+
<font color="#333333">
228+
<%= i18n.new_order_text %>
229+
</font>
230+
</div>
231+
</td>
232+
</tr>
233+
</tbody>
234+
</table>
235+
<table border="0" cellpadding="0" cellspacing="10" class="module" data-role="module-button" data-type="button" role="module" style="table-layout:fixed" width="100%"><tbody><tr><td align="center" class="outer-td" style="padding:10px 0px 15px 0px"><table border="0" cellpadding="0" cellspacing="0" class="button-css__deep-table___2OZyb wrapper-mobile" style="text-align:center"><tbody><tr>
236+
<td align="center" bgcolor="<%= themeColor %>" class="inner-td" style="border-radius:6px;font-size:16px;text-align:center;background-color:inherit"><a class="btn" style="background-color:<%= themeColor %>;border:1px solid #333333;border-color:#FFFFFF;border-radius:3px;border-width:1px;color:#FFFFFF;display:inline-block;font-family:arial,helvetica,sans-serif;font-size:16px;font-weight:normal;letter-spacing:0px;line-height:16px;padding:12px 10px 12px 10px;text-align:center;text-decoration:none" href="<% if (order.status_link) { %> <%= order.status_link %> <% } else{ %> <% if (store.homepage) { %> <%= store.homepage %>/app/#/account/orders/<%= order.number %> <% } else{ %> https://<%= store.domain %>/app/#/account/orders/<%= order.number %> <% } %> <% } %>" target="_blank"><%= i18n.order_cta %></a></td>
237+
</tr>
238+
<tr>
239+
<td style="padding: 30px 45px 0px 45px;line-height:22px;text-align:inherit;"
240+
height="100%"
241+
valign="top"
242+
bgcolor="">
243+
<div style="text-align: center;"><span style="color:#333333;">
244+
<p><%= i18n.or %> <a href="<% if (store.homepage) { %> <%= store.homepage %> <% } else{ %> https://<%= store.domain %> <% } %>"><%= i18n.visit_store %></a> </p>
245+
246+
</span></div>
247+
</td>
248+
</tr>
249+
</tbody></table></td></tr></tbody></table>
250+
251+
<% } %>
252+
253+
<% if (order && order.financial_status && order.financial_status.current) { if ( order.financial_status.current != 'unauthorized' && order.financial_status.current != 'voided') { %>
212254
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;">
213255
<tbody><tr>
214256
<% order.shipping_lines.forEach(shipping => { %>
@@ -246,6 +288,8 @@
246288
</td>
247289
</tr>
248290
</tbody></table></td></tr></tbody></table>
291+
<% } %>
292+
<% } %>
249293
250294
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;">
251295
<tbody>
@@ -410,10 +454,6 @@
410454
</tr>
411455
</table>
412456
413-
<% } %>
414-
415-
416-
417457
418458
<table class="module"
419459
role="module"

0 commit comments

Comments
 (0)