Create product add-ons using Gravity Forms ↑ Back to Top
With the Gravity Forms Product Add-ons extension, advanced product configuration forms can be built and linked to any product in WooCommerce. Forms that contain conditional logic, pricing fields, user input prices, conditional-pricing fields, conditional submit button logic can all be created for your products. Additionally, any product that contains a Gravity Form is tracked in the cart to ensure, no matter how complex your product form only unique configurations are added to the cart and duplicates are incremented in quantity.
The Gravity Forms Product Add-ons extension gives you full control over how the display of the prices in the store should appear. You can use the default price displays that WooCommerce will display, or in the case of a configurable product containing pricing fields, set the price to something such as “As Low as $1000″.
You also have control over when the built in automatic price calculation will be displayed, if at all, and have the ability to configure each label individually.
Quick Tips ↑ Back to Top
- Any license level of Gravity Forms will work with this extension.
- If you are having trouble with a form, calculations, conditional logic, etc… make sure the form works as expected on a regular post or page. Often times calculated fields or conditional logic are not configured as expected and it’s easier to track this down when using just the gravity form and not having it attached to a product.
- Make sure you disable any “Notifications” on the form, otherwise you’ll get emails each time a product is added to the cart.
Configuration ↑ Back to Top
The plugin does not require any manual configuration after activation.
A configuration change you might need to set is how HTML is formatted from specific Gravity Forms field types. One of the more common requests is to have the HTML from the List type field show as HTML and not a CSV list of data. To do this you can use a filter to turn off HTML stripping in the plugin.
To turn off HTML stripping add the following to your functions file in your theme:
$strip_html = false;
Supported Gravity Form Fields and Features ↑ Back to Top
- Single Line Text
- Drop Down
- Radio Buttons
- Paragraph Text
- Multi Select
- Section Break
- File Upload
- List ( Partial support, the column values are stored in WooCommerce as a CSV list of data, not the raw HTML )
- Option – Drop Down
- Option – Check-boxes
- Option – Radio buttons
Getting Started Guide ↑ Back to Top
Build a Gravity Form that contains any of the supported field types. Configure any conditional logic, and optionally submit button logic required. In the example below the form is configured to use pricing fields. When using pricing fields, Gravity Forms requires a product and total field. Typically you will add a hidden product field to the form and set it’s price to the price you require the customizations to start at.
Add a Product Field to the form so we can configure our base customization price starts and set it to $0.00:
The gravity forms product addon requires that at least one total field be present on the form. Add a total field to the form. In this example we are using the built in dynamic price calculations on our single product page. To prevent the customizations total from being displayed twice on the single product page ( once in the dynamically calculated price area and once in the gravity form itself), add a class of hidden-total to the field:
To add options to your form you should use the Option field type from Gravity Forms. You can use other controls, such as the standard drop down, however you must use the option field if your option has a cost associated with it.
Very Important: If you have options that have a cost associated with them, you MUST use the Product Option field type, not standard dropdowns, radios, check boxes etc.. This is the standard way that Gravity Forms works. If you trouble creating the product form, Gravity Forms documentation has several good examples.
Once you have built your form and are satisfied with the functionality, create or edit an existing WooCommerce product. With the Gravity Forms add on enabled you will have options for linking the form, options for displayng the Gravity Form title and description, and options for displaying alternative price titles throughout the store. You also have the ability to control how the dynamically calculated price is displayed on the single product page.
Once your have configured your options, publish or update your product. Navigate to the product in the store and see how your form has been linked to the product