diff --git a/app/views/split_checkout/_summary.html.haml b/app/views/split_checkout/_summary.html.haml index 131f6f3e0e..75bdb00d36 100644 --- a/app/views/split_checkout/_summary.html.haml +++ b/app/views/split_checkout/_summary.html.haml @@ -72,15 +72,7 @@ = render 'spree/orders/summary', order: @order - if any_terms_required?(@order.distributor) - %div.checkout-substep.medium-6 - %div.checkout-input - = f.check_box :accept_terms, { id: "accept_terms", name: "accept_terms", "checked": "#{all_terms_and_conditions_already_accepted?}" }, 1, nil - = f.label :accept_terms, t('split_checkout.step3.terms_and_conditions.message_html', terms_and_conditions_link: link_to( t("split_checkout.step3.terms_and_conditions.link_text"), @order.distributor.terms_and_conditions.url, target: '_blank'), tos_link: link_to_platform_terms), { for: "accept_terms" } - - = f.error_message_on :terms_and_conditions, standalone: true - - %div.checkout-input - = t("split_checkout.step3.agree") + = render partial: "terms_and_conditions", locals: { f: f } %div.checkout-submit.medium-6 = f.submit t("split_checkout.step3.submit"), name: "confirm_order", class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false diff --git a/app/views/split_checkout/_terms_and_conditions.html.haml b/app/views/split_checkout/_terms_and_conditions.html.haml new file mode 100644 index 0000000000..0acf25c899 --- /dev/null +++ b/app/views/split_checkout/_terms_and_conditions.html.haml @@ -0,0 +1,19 @@ +%div.checkout-substep.medium-6 + %div.checkout-input + - if platform_terms_required? && distributor_terms_required? + = f.check_box :accept_terms, { name: "accept_terms", checked: all_terms_and_conditions_already_accepted? }, 1, nil + = f.label :accept_terms do + = t('split_checkout.step3.all_terms_and_conditions.message_html', terms_and_conditions_link: link_to( t("split_checkout.step3.terms_and_conditions.link_text"), @order.distributor.terms_and_conditions.url, target: '_blank'), tos_link: link_to_platform_terms) + - elsif platform_terms_required? + = f.check_box :accept_terms, { name: "accept_terms", checked: platform_tos_already_accepted? }, 1, nil + = f.label :accept_terms do + = t('split_checkout.step3.platform_terms_of_service.message_html', tos_link: link_to_platform_terms) + - elsif distributor_terms_required? + = f.check_box :accept_terms, { name: "accept_terms", checked: terms_and_conditions_already_accepted? }, 1, nil + = f.label :accept_terms do + = t('split_checkout.step3.terms_and_conditions.message_html', terms_and_conditions_link: link_to( t("split_checkout.step3.terms_and_conditions.link_text"), @order.distributor.terms_and_conditions.url, target: '_blank')) + + = f.error_message_on :terms_and_conditions, standalone: true + + %div.checkout-input + = t("split_checkout.step3.agree") diff --git a/config/locales/en.yml b/config/locales/en.yml index a54951bdf3..08cc6b682b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1810,6 +1810,11 @@ en: terms_and_conditions: message_html: "I agree to the seller's %{terms_and_conditions_link}." link_text: "Terms and Conditions" + platform_terms_of_service: + message_html: "I agree to the platform %{tos_link}." + all_terms_and_conditions: + message_html: "I agree to the seller's %{terms_and_conditions_link} and the platform %{tos_link}." + terms_and_conditions: "Terms and Conditions" agree: By clicking 'Complete order' you agree to your order being processed. submit: Complete order cancel: Back to Payment method