From b9511d4f0736110874048f7bc1cd496fb94d3882 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Mon, 17 Aug 2020 22:27:49 +0100 Subject: [PATCH] Show terms and conditions on checkout if enterprise has an associated PDF file --- app/views/checkout/_form.html.haml | 1 + app/views/checkout/_terms_and_conditions.html.haml | 2 ++ config/locales/en.yml | 3 +++ 3 files changed, 6 insertions(+) create mode 100644 app/views/checkout/_terms_and_conditions.html.haml diff --git a/app/views/checkout/_form.html.haml b/app/views/checkout/_form.html.haml index 9a705ef4b5..f341a666d9 100644 --- a/app/views/checkout/_form.html.haml +++ b/app/views/checkout/_form.html.haml @@ -14,6 +14,7 @@ = render "checkout/shipping", f: f = render "checkout/payment", f: f = render "checkout/already_ordered", f: f if show_bought_items? + = render "checkout/terms_and_conditions", f: f %p %button.button.primary{type: :submit} = t :checkout_send diff --git a/app/views/checkout/_terms_and_conditions.html.haml b/app/views/checkout/_terms_and_conditions.html.haml new file mode 100644 index 0000000000..6811a738ae --- /dev/null +++ b/app/views/checkout/_terms_and_conditions.html.haml @@ -0,0 +1,2 @@ +%p + = t('.message_html', terms_and_conditions_link: link_to( t( '.link_text' ), current_order.distributor.terms_and_conditions.url, target: '_blank')) if current_order.distributor.terms_and_conditions.present? diff --git a/config/locales/en.yml b/config/locales/en.yml index 8867d8f6f7..c90755e1d5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1224,6 +1224,9 @@ en: already_ordered: cart: "cart" message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open." + terms_and_conditions: + message_html: "By placing this order you agree to the %{terms_and_conditions_link}" + link_text: "Terms of Service" failed: "The checkout failed. Please let us know so that we can process your order." shops: hubs: