Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Voucher:' before voucher code on order confirmation emails #12998

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/views/spree/order_mailer/_order_summary.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
- checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment|
%tr
%td{align: "right", colspan: "3"}
- if adjustment.originator_type == "Voucher"
= "#{t(:voucher)}:"
= "#{adjustment.label}:"
Comment on lines +46 to 48
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I suggest to use a translation here? Then we can customise the display for each language. Other possibilities could be:

  • Voucher CODE:
  • CODE (voucher):
  • CODE (discount):

You can pass the voucher code to the translation:

Suggested change
- if adjustment.originator_type == "Voucher"
= "#{t(:voucher)}:"
= "#{adjustment.label}:"
- if adjustment.originator_type == "Voucher"
= t(".voucher_label", code: adjustment.label)

And in en.yml I would add "Voucher %{code}:" as translation, avoiding the weird double colon in the line.

%td{align: "right"}
= adjustment.display_amount
Expand Down