Docs

WooCommerce Checkout Integration

4 min readUpdated June 22, 2026

WooCommerce is the most widely used WordPress ecommerce platform. WP Smart Consent supports both WooCommerce checkout types — the classic shortcode checkout and the modern Gutenberg block checkout — as separate toggleable integrations. WooCommerce 8.3.0 or higher is required.

Enabling the Integration#

In the WP Smart Consent dashboard, go to Checkout Sources. WooCommerce appears as two separate entries.

WooCommerce (Shortcode / Classic) — for stores using the [woocommerce_checkout] shortcode checkout. This is the classic checkout that has been the WooCommerce default for years and is still widely used with most themes.

A settings panel for WooCommerce shows the plugin as inactive. Tabs labeled "General" (selected) and "Collect fields" appear. The "Enable" toggle is off. "Forward to CRMs" and "Save WooCommerce" button are also visible.

WooCommerce (Block checkout / Gutenberg) — for stores using the modern woocommerce/checkout Gutenberg block, introduced as the default checkout in WooCommerce 8.3+. If you set up WooCommerce recently or switched to the block editor checkout, this is the one to enable.

Screenshot of a WooCommerce settings page with tabs for General and Collect fields. The status is set to “Inactive.” The "Enable" toggle is off, and there’s a section for forwarding data to CRMs. A green button reads “Save WooCommerce.”.

Enable whichever matches your store’s checkout type. If you run multiple checkout pages using different types, enable both. WooCommerce 8.3.0 or higher is required for either integration to activate.

Custom Fields#

WooCommerce does not have a per-form field selector. To forward additional data beyond the standard billing fields, use the Global data fields tab in the WP Smart Consent dashboard. Set the source to Order meta and enter the WooCommerce order meta key as the source key — for example _billing_city for the billing city.

Shortcode Checkout#

The classic WooCommerce checkout uses the [woocommerce_checkout] shortcode. WP Smart Consent injects the opt-in checkbox via woocommerce_after_checkout_billing_form, placing it directly below the billing address fields and above the payment section. The checkbox is rendered using woocommerce_form_field() with a type of checkbox, giving it the same WooCommerce styling class (form-row-wide) as the native checkout fields. The checkbox class can be filtered via wpsc_field_class.

When the order is placed, consent is captured on woocommerce_checkout_update_order_meta by reading $_POST['wpsc_optin']. The value is stored as order meta (wpsc_optin) and wpsc_optin_trigger fires immediately, forwarding the contact to all enabled CRM destinations. The consent state is also visible on the order detail screen in the WordPress admin under the shipping address section.

Block Checkout (Gutenberg)#

The WooCommerce Block checkout renders inside a woocommerce/checkout Gutenberg block. Because it is a React-based block, PHP hooks cannot inject markup into the checkout form directly. WP Smart Consent registers a WooCommerce Blocks integration class (CheckoutOptinBlockIntegration) via woocommerce_blocks_checkout_block_registration and a custom Store API endpoint (CheckoutOptinBlockStoreEndpoint) that extends WooCommerce’s checkout REST endpoint.

The integration class registers a custom checkout inner block that renders the opt-in checkbox inside the block checkout form. The checkbox value is submitted via WooCommerce’s blocks extension mechanism under the wpsc-checkbox-optin extension namespace, and read from $request['extensions']['wpsc-checkbox-optin']['optin'] in the woocommerce_store_api_checkout_update_order_from_request hook.

The consent value is stored as order meta (wpsc_optin) and wpsc_optin_trigger fires at that point, forwarding the contact to all enabled CRM destinations.

What Gets Forwarded#

Both checkout types forward the full WooCommerce billing address: email, first name, last name, company, address lines 1 and 2, city, state, postcode, country, and phone.

Send on Unchecked#

Both checkout types support the Send on unchecked option on individual CRM destinations. When enabled on a specific CRM, that destination receives the contact data from every WooCommerce order regardless of whether the checkbox was ticked.

Troubleshooting#

Checkbox not appearing on shortcode checkout — confirm the shortcode integration is enabled in the WPSC dashboard. The checkbox is injected via woocommerce_after_checkout_billing_form. If your theme overrides the checkout template and removes this hook, the checkbox will not appear.

Checkbox not appearing on block checkout — confirm the block integration is enabled. The block checkout uses CheckoutOptinBlockIntegration registered at woocommerce_blocks_loaded. Confirm WooCommerce Blocks is active and the checkout page uses the woocommerce/checkout block rather than the shortcode.

WooCommerce version notice in admin — WP Smart Consent requires WooCommerce 8.3.0 or higher. If your WooCommerce version is below this, a notice appears in the admin and the integration is disabled until WooCommerce is updated.

Contact forwarded but opt-in not recorded — check the order detail page in WooCommerce admin. The consent state is displayed below the shipping address under “Checkout optin confirmed?”. If it shows No, the checkbox was not ticked at checkout — check whether Send on unchecked is enabled on that CRM destination if you expected the contact to still be forwarded.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only