From ba9de403e6237adbc5181caa304265fcbf1708cd Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 25 Feb 2021 16:55:51 +1100 Subject: [PATCH] Add admin option to require shoppers agree to TOS This switch doesn't have any effect yet. We need to implement it in the checkout. --- app/models/spree/app_configuration.rb | 1 + app/views/spree/admin/general_settings/edit.html.haml | 3 +++ config/locales/en.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/app/models/spree/app_configuration.rb b/app/models/spree/app_configuration.rb index 67b843a4ce..c6b317023e 100644 --- a/app/models/spree/app_configuration.rb +++ b/app/models/spree/app_configuration.rb @@ -113,6 +113,7 @@ module Spree # Legal Preferences preference :footer_tos_url, :string, default: "/Terms-of-service.pdf" preference :enterprises_require_tos, :boolean, default: false + preference :shoppers_require_tos, :boolean, default: false preference :privacy_policy_url, :string, default: nil preference :cookies_consent_banner_toggle, :boolean, default: false preference :cookies_policy_matomo_section, :boolean, default: false diff --git a/app/views/spree/admin/general_settings/edit.html.haml b/app/views/spree/admin/general_settings/edit.html.haml index 9201fa00cb..d7014627b7 100644 --- a/app/views/spree/admin/general_settings/edit.html.haml +++ b/app/views/spree/admin/general_settings/edit.html.haml @@ -32,6 +32,9 @@ .field = preference_field_tag(:enterprises_require_tos, Spree::Config[:enterprises_require_tos], :type => Spree::Config.preference_type(:enterprises_require_tos)) = label_tag(:enterprises_require_tos, t('.enterprises_require_tos')) + tag(:br) + .field + = preference_field_tag(:shoppers_require_tos, Spree::Config[:shoppers_require_tos], :type => Spree::Config.preference_type(:shoppers_require_tos)) + = label_tag(:shoppers_require_tos, t('.shoppers_require_tos')) + tag(:br) .field = preference_field_tag(:cookies_consent_banner_toggle, Spree::Config[:cookies_consent_banner_toggle], :type => Spree::Config.preference_type(:cookies_consent_banner_toggle)) = label_tag(:cookies_consent_banner_toggle, t('.cookies_consent_banner_toggle')) + tag(:br) diff --git a/config/locales/en.yml b/config/locales/en.yml index 8aefff8022..77f55f420c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3582,6 +3582,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using cookies_consent_banner_toggle: "Display cookies consent banner" privacy_policy_url: "Privacy Policy URL" enterprises_require_tos: "Enterprises must accept Terms of Service" + shoppers_require_tos: "Shoppers must accept Terms of Service" cookies_policy_matomo_section: "Display Matomo section on cookies policy page" footer_tos_url: "Terms of Service URL" checkout: