Setting up conditional checkout fields in WooCommerce
This documentation is for the Advanced Checkout Fields for WooCommerce plugin.
In version 1.2.0 and up of the WooCommerce Advanced Checkout Fields plugin it is possible to setup conditional checkout fields, or 'field conditions' as I like to call them for clarity. From the start it has always been possible to setup conditions as per when a certain checkout field group should be applied, but with this feature you are also able to setup checkout fields that are shown / hidden in realtime.
Conditional checkout fields in WooCommerce
The conditional checkout fields can be enabled on any of the fields in the plugin. Expand a checkout field and scroll near the bottom of that option to find the 'Conditional field' setting. After checking the checkbox a new section will appear where conditions can be configured.
The conditions area should look familiar as it looks / works in a similar fashion as you have configured at the 'Advanced Checkout Conditions' meta box.
Available conditions for checkout fields
The conditions that are available for the checkout field conditions are different from the other conditions. The field conditions are more like 'question-answer' type of conditions, where you can setup the conditions based on the value of other checkout fields.
This is an example of the available conditions:
If you add a new field to the checkout fields it will automatically be added to the list of conditions and is ready for you to use.
Conditional checkout fields sample
Here's a sample of how the field conditions will be working when you've set them up:
In this sample you can see that the company name will only show up when the 'Company?' radio field has been set to 'Yes'. If the selected country falls with the EU it will also show the required EU VAT field for tax purposes
Of course you can also re-arrange the fields to have it make more sense to show the country first in the list before the Company based fields.