Adding download buttons to invoice (orders#show)
This commit is contained in:
14
app/overrides/add_digital_downloads_to_invoice.rb
Normal file
14
app/overrides/add_digital_downloads_to_invoice.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
Deface::Override.new(:virtual_path => "spree/shared/_order_details",
|
||||
:name => "add_digital_downloads_to_invoice",
|
||||
:insert_bottom => "td[data-hook='order_item_description']",
|
||||
:text => %q{
|
||||
<% if order.state == 'complete' and item.variant.digital? %>
|
||||
<%= content_tag(:p, :class => 'download_links') do %>
|
||||
<% item.digital_links.each do |digital_link| %>
|
||||
<% format = File.extname(digital_link.digital.attachment.path).downcase %>
|
||||
<%= link_to t(:digital_download, :type => t("digital_format#{format}")), digital_url(:host => Spree::Config.get(:site_url), :secret => digital_link.secret), :class => "btn #{format}" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
},
|
||||
:disabled => false)
|
||||
@@ -6,5 +6,10 @@ en:
|
||||
broken_file: Warning! this file is broken
|
||||
delete_file_cofirmation: Are you sure you want to delete the file %{filename}?
|
||||
digital_delivery: Digital Delivery
|
||||
digital_download: Download %{type} ↓
|
||||
digital_format:
|
||||
mp3: Audio MP3
|
||||
mobi: Kindle eBook
|
||||
epub: ePub eBook
|
||||
spree_digital:
|
||||
upload: Upload
|
||||
Reference in New Issue
Block a user