Fix bug in terms_and_conditions_helper related to guest checkout where current_user is nil and T&Cs must be shown all the time

This commit is contained in:
Luis Ramos
2020-10-29 15:56:41 +00:00
parent cf3f511f4d
commit 71a181341b

View File

@@ -6,7 +6,7 @@ module TermsAndConditionsHelper
end
def terms_and_conditions_already_accepted?
customer_terms_and_conditions_accepted_at = spree_current_user.
customer_terms_and_conditions_accepted_at = spree_current_user&.
customer_of(current_order.distributor)&.terms_and_conditions_accepted_at
customer_terms_and_conditions_accepted_at.present? &&