download links should not be in order unless there are digital items :)

This commit is contained in:
Captain Future committed 2011-04-22 19:16:56 +02:00
1 parent 0a4db498da
commit ba3042f98b
2 files changed
+8 -1

No files matched your search

+6
View File
@@ -6,6 +6,12 @@ Order.class_eval do
true true
end end
# Is at least one product/variant digital?
def some_digital?
line_items.map { |item| return true if item.digital? }
false
end
# Determine which method to use for shipping of digital products. # Determine which method to use for shipping of digital products.
def digital_shipping_method def digital_shipping_method
rates = rate_hash rates = rate_hash
@@ -15,6 +15,7 @@ Subtotal: <%= number_to_currency @order.item_total %>
<% end %> <% end %>
Order Total: <%= number_to_currency @order.total %> Order Total: <%= number_to_currency @order.total %>
<% if @order.some_digital? %>
============================================================ ============================================================
Download links for digital products Download links for digital products
============================================================ ============================================================
@@ -33,5 +34,5 @@ ATTENTION! Each link will only work a SINGLE TIME!
<% end %> <% end %>
<% end %> <% end %>
============================================================ ============================================================
<% end %>
Thank you for your business. Thank you for your business.