Show platform and distributor terms and conditions

This commit is contained in:
Matt-Yorkley
2022-01-25 14:48:57 +00:00
parent caab2421b3
commit 6e8bb777e6
3 changed files with 25 additions and 9 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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