mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-01 06:41:41 +00:00
Show combined checkbox when all terms required
The user should need to tick only one box to agree. We don't remember yet if someone agreed to the platform TOS and therefore the box is always unticked to start with. Remembering the agreement is another issue: https://github.com/openfoodfoundation/openfoodnetwork/issues/6328
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
module TermsAndConditionsHelper
|
||||
def render_terms_and_conditions
|
||||
if platform_terms_required? && terms_and_conditions_activated?
|
||||
render("checkout/terms_and_conditions") + render("checkout/platform_terms_of_service")
|
||||
render("checkout/all_terms_and_conditions")
|
||||
elsif platform_terms_required?
|
||||
render "checkout/platform_terms_of_service"
|
||||
elsif terms_and_conditions_activated?
|
||||
|
||||
4
app/views/checkout/_all_terms_and_conditions.html.haml
Normal file
4
app/views/checkout/_all_terms_and_conditions.html.haml
Normal file
@@ -0,0 +1,4 @@
|
||||
%p
|
||||
%input{ type: 'checkbox', id: 'accept_terms', ng: { model: "terms_and_conditions_accepted", init: "terms_and_conditions_accepted=false" } }
|
||||
%label.small{for: "accept_terms"}
|
||||
= t('.message_html', terms_and_conditions_link: link_to( t(".terms_and_conditions"), current_order.distributor.terms_and_conditions.url, target: '_blank'), tos_link: link_to(t(".terms_of_service"), Spree::Config.footer_tos_url, target: "_blank"))
|
||||
@@ -1249,6 +1249,10 @@ en:
|
||||
platform_terms_of_service:
|
||||
message_html: "I agree to the platform %{tos_link}."
|
||||
terms_of_service: "Terms of Service"
|
||||
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"
|
||||
terms_of_service: "Terms of Service"
|
||||
failed: "The checkout failed. Please let us know so that we can process your order."
|
||||
shops:
|
||||
hubs:
|
||||
|
||||
@@ -218,13 +218,11 @@ feature "As a consumer I want to check out my cart", js: true do
|
||||
expect(page).to have_link("Terms of Service", href: tos_url)
|
||||
expect(page).to have_button("Place order now", disabled: true)
|
||||
|
||||
# Both Ts&Cs and TOS appear in the one label for the one checkbox.
|
||||
check "Terms and Conditions"
|
||||
expect(page).to have_button("Place order now", disabled: true)
|
||||
|
||||
check "Terms of Service"
|
||||
expect(page).to have_button("Place order now", disabled: false)
|
||||
|
||||
uncheck "Terms and Conditions"
|
||||
uncheck "Terms of Service"
|
||||
expect(page).to have_button("Place order now", disabled: true)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user