=== Dreamfox Checkout Logic Builder for WooCommerce ===
Contributors: dreamfox
Tags: woocommerce, checkout fields, checkout builder, conditional fields, checkout
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add, edit, hide and reorder WooCommerce checkout fields with conditional logic — on both the classic and the block checkout.

== Description ==

**Dreamfox Checkout Logic Builder for WooCommerce** gives you full control over your checkout form. Add your own fields, hide or relabel the built-in ones, reorder everything with drag-and-drop, and show fields only when they are relevant with conditional logic — all with custom validation rules and your own error messages.

The big differentiator: it works on **both WooCommerce checkouts**. The classic `[woocommerce_checkout]` shortcode and the block checkout (the default since WooCommerce 8.3) are driven by the same field definitions, and a captured value lands on the order under the same meta key (`_dfclb_{field id}`) either way. Migrate checkouts whenever you like — your fields and your data pipeline don't change.

= Free features =

* **Six field types** – text, textarea, select (dropdown), checkbox, radio buttons and date.
* **Both checkouts** – one definition renders on the classic shortcode checkout AND the block checkout.
* **Three sections** – attach fields to the billing address, shipping address or order (additional information) area.
* **Drag-and-drop ordering** – the order in the builder is the order at checkout.
* **Manage default fields** – hide, relabel or change the required-ness of every built-in WooCommerce checkout field.
* **Conditional logic** – show a field only when another field has a certain value; on the classic checkout also based on cart total, cart contents, shipping method or payment method.
* **Custom validation** – regex pattern, minimum/maximum length and a custom error message per field.
* **Placeholder, default value, CSS class and help text** per field.
* **Values everywhere they matter** – on the admin order screen, in customer and admin order emails, on the customer's order details page, in the WooCommerce REST API (`meta_data`) and in the WordPress personal-data export/erase tools (GDPR).
* **JSON import/export** – back up your field setup or copy it to another store.
* **Duplicate a field** – iterate on variations quickly.
* **Reset to defaults** – one action restores the stock WooCommerce checkout.
* **Conflict detection** – a friendly heads-up when another checkout-field plugin is active.
* **Translation ready** – all strings localizable; field labels are filterable (`dfclb_field_label`) for WPML/Polylang string translation.
* **HPOS compatible** – declares full High-Performance Order Storage support and uses CRUD meta throughout.
* **Lightweight** – assets are only enqueued on the checkout page and the plugin's own settings screen.

= Block checkout notes (honest fine print) =

The block checkout supports a smaller set of field types than the classic checkout. Definitions degrade gracefully, and the builder shows a badge on affected types so you're never surprised:

* **Textarea** renders as a single-line text field (multiline content is not possible there).
* **Radio buttons** render as a dropdown.
* **Date** renders as a text field validated against the `YYYY-MM-DD` format.

Conditional logic on the block checkout currently covers **field-value conditions**. Conditions on cart total, cart contents, shipping method or payment method apply to the classic checkout only.

Hiding or relabeling default *address* fields applies to the classic checkout; the block checkout manages its own address fields.

Built by [Dreamfox Media](https://dreamfoxmedia.com).

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/dreamfox-checkout-logic-builder`, or install through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen.
3. Go to **WooCommerce → Checkout Fields** and open the **Fields** tab to add your first custom field.
4. Optionally hide or relabel built-in fields under **Default Fields**.

== Frequently Asked Questions ==

= Does this work with the block checkout? =

Yes — that's the point. Fields defined in the builder are registered with WooCommerce's Additional Checkout Fields API for the block checkout and injected into `woocommerce_checkout_fields` for the classic checkout. The captured value is stored under the same `_dfclb_{field id}` order-meta key in both cases.

= Why does my textarea/radio/date field look different on the block checkout? =

The block checkout natively supports text, select and checkbox fields. Other types degrade to the closest supported type: textarea becomes single-line text, radio becomes a dropdown, and date becomes a text field validated as `YYYY-MM-DD`. The builder shows a badge on these types.

= Where do I find the captured values? =

On the order screen in wp-admin (a "Checkout fields" box), in the order emails, on the customer's order-received/view-order page, and via the REST API in the order's `meta_data` under `_dfclb_{field id}`.

= Can I show a field only for certain countries? =

Yes. Add a conditional-logic rule like "billing_country equals NL" to the field. The field then appears only when that condition holds, live in the browser and enforced again server-side. A field hidden by its conditions is never validated as required.

= Can conditions depend on the cart or the payment method? =

On the classic checkout, yes: cart total, cart contents (product ID), shipping method and payment method are all available as rule sources. On the block checkout, only field-value rules apply in v1.

= Does it support a multi-step checkout plugin? =

Multi-step checkouts are not actively supported or tested. On the classic side the plugin uses only standard WooCommerce hooks (`woocommerce_checkout_fields`, checkout validation and order creation), so a multi-step plugin that keeps those hooks intact will usually work — but that's a bonus, not a promise.

= What happens to captured values when I delete a field or uninstall? =

Nothing. Values already stored on orders are order data and are kept. Uninstalling removes only the plugin's settings.

= Is it GDPR-friendly? =

Yes. Captured values are included in WooCommerce's personal-data export for an order and removed when an order is anonymized via the WordPress erase tools.

= Is the plugin compatible with HPOS (High-Performance Order Storage)? =

Yes, the plugin declares full HPOS compatibility and only ever touches order meta through the CRUD API.

== Screenshots ==

1. The Fields tab: drag-and-drop builder with block-checkout compatibility badges.
2. Editing a field: type, section, validation and conditional logic.
3. Default Fields: hide, relabel or change required-ness of built-in fields.
4. A custom field on the classic checkout.
5. The same field on the block checkout.
6. Captured values on the admin order screen and in the order email.
7. Tools: JSON import/export and reset.

== Changelog ==

= 1.0.2 =
* Maintenance release for WordPress.org resubmission under the new name.

= 1.0.1 =
* Renamed to Dreamfox Checkout Logic Builder for WooCommerce.

= 1.0.0 =
* Initial release: custom fields on both the classic and block checkout, default-field management, conditional logic, custom validation, JSON import/export, GDPR integration, HPOS compatible.

== Upgrade Notice ==

= 1.0.2 =
Maintenance release, no functional changes.

= 1.0.1 =
Renamed to Dreamfox Checkout Logic Builder for WooCommerce.

= 1.0.0 =
Initial release.
