Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed issue where the digital links section would be shown regardless…

… of if there were digital items. Moved some of the description text to the locale file.
  • Loading branch information...
commit ef996cde3148868657fec33464e0d43a58bc6c63 1 parent 9de9d60
@iloveitaly iloveitaly authored
View
9 app/views/spree/shared/email/_order_details.html.erb
@@ -92,14 +92,16 @@
</table>
<% if Rails.application.railties.all.map(&:railtie_name).include? 'spree_digital' %>
+<% digital_items = @order.line_items.select{ |i| i.digital? } %>
+<% unless digital_items.empty? %>
<div class="spacer_15">&nbsp;</div>
<h2><span><%= t(:digital_download_links) %></span></h2>
-<p>Each link will only work a SINGLE TIME! Also, they will only work WITHIN 24 HOURS!</p>
+<p><%= t(:digital_email_description) %></p>
-<% @order.line_items.select{ |i| i.digital? }.each do |item| %>
+<% digital_items.each do |item| %>
<p><%= item.variant.name %>:<br/>
<%
-for link in item.digital_links
+item.digital_links.each do |link|
digital_url = digital_url(:host => Spree::Config.get(:site_url), :secret => link.secret)
%>
<%= link_to digital_url, digital_url%>
@@ -107,3 +109,4 @@ for link in item.digital_links
<% end %>
<% end %>
<% end %>
+<% end %>
View
2  config/locales/en.yml
@@ -1,4 +1,6 @@
en:
+ digital_email_description: Each link will only work a SINGLE TIME! Also, they will only work WITHIN 24 HOURS!
+
time:
formats:
short: "%B %d, %Y"
Please sign in to comment.
Something went wrong with that request. Please try again.