Skip to content

Commit

Permalink
Fixed issue where the digital links section would be shown regardless…
Browse files Browse the repository at this point in the history
… of if there were digital items. Moved some of the description text to the locale file.
  • Loading branch information
iloveitaly committed Apr 24, 2012
1 parent 9de9d60 commit ef996cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/views/spree/shared/email/_order_details.html.erb
Expand Up @@ -92,18 +92,21 @@
</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%>
</p>
<% end %>
<% end %>
<% end %>
<% end %>
2 changes: 2 additions & 0 deletions 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"

0 comments on commit ef996cd

Please sign in to comment.