Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Include gift card in order email (#14012)

Kacper Mękarskid6295621c270
diff --git a/spree/emails/app/views/spree/shared/_purchased_items_table.html.erb b/spree/emails/app/views/spree/shared/_purchased_items_table.html.erb
index 10045ec218..7ed5a56d7a 100644
--- a/spree/emails/app/views/spree/shared/_purchased_items_table.html.erb
+++ b/spree/emails/app/views/spree/shared/_purchased_items_table.html.erb
@@ -56,6 +56,21 @@
</td>
</tr>
<% end %>
+ <% if order.gift_card_total.positive? %>
+ <tr>
+ <td></td>
+ <td>
+ <p class="f-fallback purchase_total purchase_total--label">
+ <%= Spree.t(:gift_card) %>:
+ </p>
+ </td>
+ <td class="purchase_total-col">
+ <p class="f-fallback purchase_total">
+ -<%= order.display_gift_card_total.to_html %>
+ </p>
+ </td>
+ </tr>
+ <% end %>
<% order.adjustments.eligible.each do |adjustment| %>
<% next if (adjustment.source_type == 'Spree::TaxRate') || (adjustment.amount == 0) %>
<%= render 'spree/shared/purchased_items_table/adjustment', adjustment: adjustment, order: order %>
diff --git a/spree/emails/app/views/spree/shared/_purchased_items_table.text.erb b/spree/emails/app/views/spree/shared/_purchased_items_table.text.erb
index 16399b0513..fe45501e99 100644
--- a/spree/emails/app/views/spree/shared/_purchased_items_table.text.erb
+++ b/spree/emails/app/views/spree/shared/_purchased_items_table.text.erb
@@ -19,6 +19,10 @@
<%= Spree.t(:tax) %>: <%= order.display_additional_tax_total.to_html %>
<% end %>
+<% if order.gift_card_total.positive? %>
+ <%= Spree.t(:gift_card) %>: -<%= order.display_gift_card_total.to_html %>
+<% end %>
+
<% order.adjustments.eligible.each do |adjustment| %>
<% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
<%= adjustment.label %> <%= adjustment.display_amount %>