From 7ab065e8cd12bb3c55f712582dd1eb79fe5f953e Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Tue, 18 May 2021 16:32:47 +0200 Subject: [PATCH] Add section at the bottom of invoice: Payment Description at Checkout - If there is any payments, we use the last one to retrieve the payment method description Use the first completed payment to display payment description Completed is state = "checkout" or state = "completed" Squash w/ "Add section at the bottom of invoice: Payment Description at Checkout" Squash w "Add section at the bottom of invoice: Payment Description a" --- app/views/spree/shared/_payment.html.haml | 5 +++++ config/locales/en.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/app/views/spree/shared/_payment.html.haml b/app/views/spree/shared/_payment.html.haml index f13e9b7892..0c1bc8c8d0 100644 --- a/app/views/spree/shared/_payment.html.haml +++ b/app/views/spree/shared/_payment.html.haml @@ -13,3 +13,8 @@ = t :email_payment_summary - if @order.payments.any? = render partial: 'spree/shared/payments_list', locals: { payments: @order.payments } + - if last_payment_method(@order).present? + %p.callout{style: "margin-top: 40px"} + %strong + = t :email_payment_description + %p{style: "margin: 5px"}= last_payment_method(@order).description diff --git a/config/locales/en.yml b/config/locales/en.yml index a8d7ec57e7..8ac5f28653 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1669,6 +1669,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using email_order_summary_includes_tax: "(includes tax):" email_payment_paid: PAID email_payment_not_paid: NOT PAID + email_payment_description: Payment Description at Checkout email_payment_summary: Payment summary email_payment_method: "Paying via:" email_so_placement_intro_html: "You have a new order with %{distributor}"