Add different input fields or prices to specific variations
Advanced Product Fields for WooCommerce (APF) also works with variable products. This means you can conditionally display different input fields – or different pricing logic – depending on the product variation selected by the customer.
We’ll cover 2 things in this guide:
- How to display fields only when a certain variation is selected.
- Build pricing logic which depends on the selected variation.
Let’s dive in!
How to display fields only when a certain variation is selected?
A common example is offering size options, where selecting “Custom” displays additional fields for customers to input their specific measurements. Here’s an animation of what we’re building:

- Via the WP admin menu, go to WooCommerce → Product Fields and click Add New. This is where you can create fields and assign to one or multiple product variations.
- Create the input field(s) that should appear when a specific variation is selected. If you need help on how to create fields, you can read our getting started tutorial here.
- After creating your fields, scroll down to the Conditions section of the page. Here, you can specify which products or variations the fields should be displayed on. Click Add your First Rule.
- In the first dropdown list, you can select a condition. Choose Product Variation. In the last dropdown list, you can search for the variation.
That’s it! Your input fields now only appear on 1 variation.
Build pricing logic which depends on the selected variation
What if the input fields affect the pricing, and the value changes based on the selected variation? This is also possible with Advanced Product Fields!
In the below example, we added a checkbox “Add Premium Coating” which adds $10 additional cost when a variation is selected. When another (higher) variation is selected, the field’s cost changes to $20:

- In part 1 of this tutorial, you’ve learned how to add a field to a variation. We used this knowledge to create a simple checkbox with an additional cost of $10 and assign it to a variation. Here’s a simplified screenshot showing the relevant settings:
- To change the price when a different variation is selected, we will duplicate the field and change the price. Go back to WooCommerce → Product Fields, hover over the field group and click Duplicate. This saves you a lot of manual work.
- Now edit the duplicated field group, update the field’s pricing, and assign it to your other variations. Here’s a simplified screenshot showing the relevant settings:
That’s it! You now have a field that changes pricing depending on which variation the customer selects.