A WordPress plugin that adds a checkbox-based product field to Gravity Forms, allowing users to select multiple products with individual prices that calculate into the form total.
- Checkbox Product Field - New field type in the Pricing Fields section
- Individual Pricing - Each checkbox option can have its own unique price
- Live Price Calculation - Form total updates in real-time as selections change
- Payment Gateway Integration - Works with Stripe, PayPal, and other GF payment add-ons
- Easy Configuration - Simple admin interface for adding products and prices
- Entry Details - Selected products display in entry details and notifications
- Merge Tag Support - Use in notifications, confirmations, and merge tags
- Conditional Logic - Full Gravity Forms conditional logic support
- Responsive & Accessible - Mobile-friendly and WCAG 2.1 compliant
- WordPress 5.8 or higher
- Gravity Forms 2.5 or higher
- PHP 7.4 or higher
- Download the plugin zip file
- Go to WordPress Admin → Plugins → Add New
- Click "Upload Plugin" and select the zip file
- Click "Install Now" and then "Activate"
- Upload the
gf-checkbox-productsfolder to/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Create or edit a Gravity Form
- Add the "Checkbox Products" field from the Pricing Fields section
- Configure your product choices:
- Label: The product name displayed to users
- Value: Internal identifier (auto-generated from label)
- Price: Individual price for this product
- Add a "Total" field to display the calculated total
- (Optional) Add a payment feed for Stripe, PayPal, etc.
Field Label: "Select Your Options"
Choices:
- Lunch Ticket ($25.00)
- Workshop Session ($50.00)
- Event T-Shirt ($15.00)
- Printed Materials ($10.00)
Field Label: "Select Services"
Choices:
- Basic Package ($99.00)
- SEO Optimization ($149.00)
- Content Writing ($199.00)
- Social Media Setup ($79.00)
Field Label: "Select Products"
Choices:
- Product A ($29.99)
- Product B ($39.99)
- Product C ($49.99)
gf-checkbox-products/
├── gf-checkbox-products.php # Main plugin file
├── readme.txt # WordPress readme
├── README.md # This file
├── .gitignore # Git ignore rules
├── includes/
│ ├── class-gf-field-checkbox-product.php # Custom field class
│ ├── class-gf-checkbox-products-admin.php # Admin functionality
│ └── class-gf-checkbox-products-pricing.php # Pricing logic
├── assets/
│ ├── js/
│ │ ├── admin.js # Admin field settings UI
│ │ └── frontend.js # Frontend price calculations
│ └── css/
│ ├── admin.css # Admin styles
│ └── frontend.css # Frontend styles
└── languages/
└── gf-checkbox-products.pot # Translation template
The main field class that extends GF_Field. Handles:
- Field rendering on frontend
- Value submission and storage
- Entry display formatting
- Merge tag values
- Validation
Handles admin functionality:
- Field settings UI in form editor
- Admin scripts and styles
- Tooltips and help text
Manages pricing integration:
- Integration with GF pricing system
- Payment gateway compatibility
- Frontend price calculation scripts
- Product total calculations
The plugin uses several Gravity Forms hooks:
// Register pricing field type
add_filter('gform_pricing_fields', [$this, 'register_pricing_field']);
// Add products to order
add_filter('gform_product_info', [$this, 'add_checkbox_products_to_order'], 10, 3);
// Enqueue scripts
add_action('gform_enqueue_scripts', [$this, 'enqueue_frontend_scripts'], 10, 2);
// Field settings
add_action('gform_field_standard_settings', [$this, 'field_settings_ui'], 10, 2);Frontend JavaScript provides a public API:
// Calculate total for a specific form
GFCheckboxProducts.calculateTotal(formId);
// Trigger recalculation
GFCheckboxProducts.recalculate(formId);Add custom CSS classes in the field settings:
/* Target specific checkbox products field */
.my-custom-class .gfield_checkbox_product label {
font-weight: bold;
}
/* Card-style layout (built-in) */
.gf-checkbox-card-style .gfield_checkbox_product label {
/* Styles are already included */
}Use filters to modify product data:
// Modify products before adding to order
add_filter('gform_product_info', function($product_info, $form, $entry) {
// Your custom logic
return $product_info;
}, 20, 3);- Field appears in form editor Pricing Fields section
- Can add/edit/remove product choices
- Choices save correctly
- Frontend displays checkboxes with prices
- Selecting checkboxes updates total in real-time
- Form submission saves selections
- Entry detail shows selected products
- Works with payment gateways (Stripe, PayPal)
- Conditional logic works
- AJAX forms work correctly
- Multi-page forms work correctly
- Merge tags display correctly
- Responsive on mobile devices
-
Stripe Testing:
- Use test mode with test card: 4242 4242 4242 4242
- Verify line items appear correctly in Stripe dashboard
-
PayPal Testing:
- Use PayPal sandbox mode
- Verify product names and prices in PayPal
If the total isn't updating when checkboxes are selected:
- Ensure you have a "Total" field added to your form
- Check browser console for JavaScript errors
- Verify Gravity Forms is version 2.5 or higher
- Try disabling other plugins to check for conflicts
- Verify the field is configured with prices
- Check that the payment feed is properly configured
- Ensure the form has a "Total" field
- Test with a simple form to isolate the issue
- Ensure Gravity Forms 2.5+ is installed
- Check that the plugin is activated
- Look for errors in WordPress debug log
- Verify PHP version is 7.4 or higher
For support, please:
- Check the FAQ section
- Search existing GitHub Issues
- Create a new issue with detailed information
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Planned features for future versions:
- Quantity input per checkbox
- Product images
- Inventory tracking
- Choice-level conditional logic
- Bulk pricing/discounts
- Choice categories
- Min/max selection limits
- Dynamic pricing formulas
- WooCommerce integration
- Subscription support
- Advanced reporting
This plugin is licensed under the GPL v2 or later.
Copyright (C) 2024
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Developed by Ricky Poon
Built with Gravity Forms
- Initial release
- Checkbox Products field type
- Individual product pricing
- Live price calculations
- Payment gateway integration
- Entry display and notifications
- Merge tag support
- Conditional logic support
- Responsive and accessible design