Swift Commerce
Menu
Features

Your next store tool is here.

Explore 16 store features. Unlock their full capabilities with Pro.

Sell & personalize

Product Bundles

Sell complementary products together.

Product Addons

Offer extra choices and personalisation.

Subscriptions

Offer products on a recurring schedule.

Product Quantity Limits

Set minimum and maximum quantities.

Shopping experience

Ajax Search

Show products as shoppers type.

Wishlist

Give saved products a place to wait.

Currency Switcher

Display prices in a familiar currency.

Add to Cart Popup

Confirm additions and the next step.

Customer relationships

Cart Recovery

Follow up on unfinished purchases.

Back In Stock

Notify interested shoppers when stock returns.

Shipment Tracking

Share tracking details for orders.

Email Customizer

Customize supported customer emails.

Security & checkout

Registration & Access

Build forms, verify emails and review accounts.

reCAPTCHA

Add checks to supported forms.

Cookie Consent

Offer preferences and managed integration gating.

Checkout Field Editor

Adapt supported checkout fields.

View all features · See Pro plans

Solutions

Built around the way you work.

Store owners

Tools for the everyday work of running a store.

Freelancers

Build and hand over a more consistent setup.

Agencies

Bring a familiar toolkit to client projects.

Integrations

Explore supported connections and compatibility.

Resources

A little help goes a long way.

Documentation

Setup guides and feature reference.

Blog & updates

Product news and store ideas.

Contact us

Talk to the Swift Commerce team.

About Swift Commerce

The people and thinking behind the suite.

Affiliate program

Earn commission by referring new customers.

Request a feature

Tell us what your store needs next.

Report a bug

Help us investigate a problem.

← Back to articles

How to Add Conditional Fields to the WooCommerce Checkout Page

Show WooCommerce checkout fields only when they’re needed. Set up conditional rules with Swift Commerce Pro on classic checkout, then test both outcomes.

A business order selection revealing a company-reference checkout field.

Conditional fields let a WooCommerce checkout ask follow-up questions only when they apply. In this classic-checkout example, Swift Commerce Pro shows a Company reference field when the customer chooses a Business order.

We’ll use Swift Commerce to show a Company reference field only when the customer selects Business as the order type. It’s a small example, but it shows how the trigger field, stored option value, and conditional rule fit together.

Before adding conditional fields to classic checkout

  • WooCommerce and Swift Commerce Free are active.
  • Swift Commerce Pro is installed and active with access to its premium features.
  • Checkout Field Editor is enabled.
  • Your checkout uses the classic WooCommerce checkout.

This Swift Commerce conditional-logic setup is for classic checkout, not Checkout Blocks. Check your checkout page in the WordPress editor before starting. A classic checkout commonly uses the [woocommerce_checkout] shortcode; a Checkout block is a different checkout implementation.

If you need fields in Checkout Blocks, use our Checkout Blocks custom order fields guide. Don’t replace a live checkout type without testing the effect on your other checkout integrations.

1. Open the field editor

  1. In Swift Commerce, open Checkout Field Editor.
  2. Enable the feature if needed.
  3. Choose the Field Editor tab.
  4. Focus on Billing Details, which we’ll use for the two example fields.
Swift Commerce Checkout Field Editor with the Add Field button in Billing details.

Keep the trigger and its dependent field together so the customer sees the question before the follow-up. Don’t disable core address fields to create space; those fields may be needed for shipping, tax, or payment.

2. Create the Order type dropdown

  1. In the section, click Add Field and choose Select.
  2. In General, set Label to Order type.
  3. Give it a unique lowercase Field Key, such as additional_order_type.
  4. Open Options and create the two choices below.
  5. If every customer must choose an order type, enable Required Field in Validation.
  6. Click Add Field to add the new field to the editor.
Select field type in the Add Field to Billing details dialog.
Order Type field with the lowercase key order_type and Field Enabled switched on.
Order Type select options with Person mapped to personal and Business mapped to business.
Label customers seeValue the rule uses
Personalpersonal
Businessbusiness

The label and value are different things. The customer sees “Business,” but the conditional rule matches the stored value business. Keep those values clear and consistent. Avoid changing a saved field key later without checking the effect on existing configuration.

3. Create the follow-up field

  1. In the same section, click Add Field and choose Text.
  2. Set Label to Company reference.
  3. Set a unique Field Key, such as additional_company_reference.
  4. Add a description if the buyer needs an example of the reference you accept.
  5. Keep Field Enabled on.
Company reference checkout field with the lowercase key company_reference.

If a reference is optional for business orders, leave it optional in Validation. If it’s genuinely required for those orders, enable Required Field and test validation with the conditional rule in place.

4. Add the conditional rule

While editing Company reference, open its Logic tab. Configure the rule on the field you want to show or hide, not on the Order type dropdown.

  1. Turn on Enable Conditional Logic.
  2. Set Action to Show this field.
  3. Set Match to All rules match (AND).
  4. Click Add Rule.
  5. Choose Order type as the trigger field.
  6. Choose Equals as the operator.
  7. Select or enter the Business option’s stored value, business.
  8. Click Add Field for a new field, or Save Changes when editing an existing one.
Logic tab with conditional logic enabled, Show this field selected, and the Add Rule button.
Conditional rule showing Company reference when Order Type equals Business.

The intended result is: show Company reference when Order type equals business. With Personal selected, the follow-up field should be hidden.

If you can’t select Order type as a trigger, confirm it was added to the editor, is enabled, and isn’t the field you’re currently editing. A field cannot use itself as its own trigger.

5. Save the feature configuration

Arrange the fields so Order type appears before Company reference. Then click Save Changes in the feature header. Saving the dialog adds the field to the editor; saving the feature persists the full configuration.

The main Conditional Logic tab provides a place to review fields with rules. You don’t need to create a second copy of the same rule there.

6. Test both sides of the condition

  1. Add a product to the cart and open classic checkout.
  2. Choose Personal. Confirm Company reference is hidden.
  3. Choose Business. Confirm Company reference appears.
  4. If you made the reference required, try submitting the business order without it and check the validation message.
  5. Switch back to Personal and confirm the hidden follow-up doesn’t block that checkout.
  6. Place a test business order with a reference and check the saved value in WooCommerce’s order details.

Repeat the interaction after a checkout update, such as changing an address or shipping choice. Also check on a phone. Dynamic checkout updates shouldn’t leave you with a field that only worked on the first page load.

How AND and OR change the result

For one rule, AND and OR have the same practical result. They matter when you add more conditions:

  • All rules match (AND): every condition must be true before the action applies.
  • Any rule matches (OR): one matching condition is enough.

Start with a single rule and verify it before adding more. If a field shows unexpectedly, check the action, the trigger’s stored value, and whether you chose OR when you meant AND.

Can I use a checkbox as the trigger?

Yes. Choose the checkbox field and use an operator suited to it, such as Is checked or Is unchecked. Don’t treat a checkbox like a text field and guess the value it submits.

Can the dependent field be a file upload?

Yes, on classic checkout with Pro. You still need to configure the upload field’s allowed types and size limits. Our classic checkout file-upload guide walks through that setup.

For the complete field types and settings, see the Checkout Field Editor documentation.

Check the Swift Commerce listing on WordPress.org for Free installation requirements and downloads.

For the next setup task, see Checkout Field Editor capabilities.