cwcfp_before_conditional_field_grouping

The cwcfp_before_conditional_field_grouping filter controls what is displayed before each group of fields when your fields are set to repeat based on the quantity of a given product in the customer's cart.

For example, you may want to add a heading that says Customer 1 before a group of fields for the first customer, then another heading that says Customer 2 before a group of fields for the second customer.

The filter has three arguments:

  • $content: This is the content that would otherwise be displayed before the field based on the Before Field setting.
    <div class="cwcfp-before-conditional-field-group" id="cwcfp-before-conditional-field-1">Before Field from settings</div>
  • $repeat: This will be the quantity that the field repeats. This can be used to display Customer 1, Customer 2, etc. dynamically.
  • $field_number: The field ID from the Conditional Fields settings. This can help you determine what to display before a certain set of fields.