A CiviCRM extension that enables participant-specific pricing through a configuration-driven, server-side approach. This extension eliminates the need for fragile JavaScript/CSS manipulations by providing clean, maintainable participant type conditions on price fields.
Instead of using JavaScript to hide/show price fields based on participant type, this extension implements a server-side solution that:
- Adds a "Participant Type" configuration option when creating price fields
- Controls field visibility during event registration form rendering
- Supports three participant type conditions:
- All Participants - Field visible to all participants (default)
- Primary Participant Only - Field only visible to the first/primary participant
- Additional Participant Only - Field only visible to secondary participants
- Admins configure participant type constraints when setting up price fields
- No code changes required to implement different pricing strategies
- Works across all event types without modification
- Price field visibility is determined server-side during form rendering
- Fields are filtered at the
buildAmounthook, ensuring consistency - No reliance on client-side logic that can be bypassed or break
-
Copy the extension directory to your CiviCRM extensions directory:
cp -r com.skvare.priceconditionfields /path/to/civicrm/extensions/
-
Enable the extension through the CiviCRM UI:
- Navigate to Administer > System Settings > Extensions
- Find "Price Condition Fields" and click Install
- Navigate to Administer > CiviEvent > Price Sets
- Create or edit a price set
- Add a price field
- Then edit the price field to configure participant type conditions
When editing a price field, you'll see a new dropdown:
Participant Type:
- All Participants (default) - Everyone can see this field
- Primary Participant Only - Only the first participant sees this field
- Additional Participant Only - Only secondary participants see this field
Assign the price set to your event as usual. The extension handles the rest.
Scenario 1: Event with Base Fee + Shirt Sizing
- Price Field 1 (Event Base Fee): All Participants
- Charged to every participant
- Price Field 2 (Shirt Size): Primary Participant Only
- Ordered once for entire group, or additional cost only at primary level
Scenario 2: Discounted Registrations
- Price Field 1 (Full Price): Primary Participant
- Full price for first participant
- Price Field 2 (Group Rate): Additional Participant
- Discounted rate for additional participants in same registration
Adds the "Participant Type" dropdown to the Price Field form (CRM_Price_Form_Field)
Saves the participant type condition to the database when a price field is saved
Filters price fields during form rendering based on:
- Current participant type (detected from form context)
- Configured participant type conditions on each price field
- CiviCRM: 5.81+
- Drupal: 10, 11 (with CiviCRM module)
- WordPress: 5.0+ (with CiviCRM plugin)
- PHP: 8.3+
- Issues: Report bugs and feature requests on GitHub Issues
Developed by Skvare, LLC for the CiviCRM community.
Skvare LLC specializes in CiviCRM development, Drupal integration, and providing technology solutions for nonprofit organizations, professional societies, membership-driven associations, and small businesses. We are committed to developing open source software that empowers our clients and the wider CiviCRM community.
Contact Information:
- Website: https://skvare.com
- Email: info@skvare.com
- GitHub: https://github.com/Skvare
Contact us for support or to learn more.