Terms of Service agreement as hidden field?

The new, built-in Terms of Service agreement checkbox option in v2.0 Configuration settings is very nice, one less custom item to manually configure.

The only issue is, by default it seems this custom field is not hidden, and therefore gets displayed on the Receipt and in the Email. It would be very helpful if an additional option to set the hidden (h:) flag on this tos_agreement field was made available.

Without it, you end up having to hard-code exceptions in the the Twig, like this:
{% if ( not custom_field.is_hidden ) and ( key != 'TOS Agreement' ) %}
Further, it gets complicated dealing with:
{% if ( has_visible_custom_fields ) %}
...since the presence of tos_agreement causes this condition to always be true... even though you may only have hidden custom fields attached to the order.
Comments
  • fc_adamfc_adam FoxyCart Team
    @pixelchutes,

    Great point. We hadn't considered someone wanting that to be a hidden agreement - we had taken the approach that by maintaining that visibility all parties have a record that the ToS was agreed to.

    I'll create a ticket on our side to look into adding a configuration option to mark it as hidden - for now though perhaps a better approach would be to edit the checkout template to have the field added prepended with h: rather than trying to hide it after the fact.
  • fc_adamfc_adam FoxyCart Team
    @pixelchutes,

    Quick update - you can now specify the ToS configuration as being a hidden field.
  • Awesome news, thank you for this!
Sign In or Register to comment.