Allow visibility of Xprofile field groups to depend on products or categories in cart
wc4bp_custom_checkout_field_group_visibility filter allows the visibility of a group to be altered based on any criteria. By default, it is hooked by a function that looks at the user's cart and makes the group visible if its contents overlap with a set of products or categories.
The actual products or categories that make a group visible can be configured using
wc4bp_wc_categories_that_allow_group_visibility filters. These filters both use the group ID as an argument. They return false by default, which means that the group will always be visible, but can be hooked to return an array of product IDs or category IDs, respectively.