Hi,
On our WoodMart site, the WooCommerce Order Attribution element is rendered outside the checkout form. Because of that, the attribution fields are never submitted and every checkout order is saved with Origin “Unknown”.
Setup
– WoodMart [VERSION], checkout built with Layout Builder (custom Checkout layout), [PAGE BUILDER]
– WooCommerce 11.1.2 with Order Attribution enabled
– WPML active, tested on the English checkout at /en/checkout/
– Guest checkout disabled, Stripe gateway
What we see
WooCommerce outputs one wc-order-attribution-inputs element on the checkout page. It is present, but it is not inside form.checkout.
Console results on /en/checkout/ (logged in, items in cart):
document.querySelectorAll(‘wc-order-attribution-inputs’).length
Result: 1
!!document.querySelector(‘form.checkout wc-order-attribution-inputs’)
Result: false
new FormData(document.querySelector(‘form.checkout’)).get(‘wc_order_attribution_source_type’)
Result: null
Already ruled out
– Consent: wc_order_attribution.params.allowTracking is true and the WP Consent API is not active
– Feature setting: Order Attribution is enabled
– Payment method: affected orders are standard card payments
Questions
1. As far as we understand, WooCommerce adds this element once, on the first of its standard checkout hooks to fire (for example woocommerce_after_checkout_billing_form or woocommerce_checkout_after_customer_details). Is one of these hooks fired outside the form tag in the Layout Builder checkout?
2. Is this a known issue, and is there a fix or a recommended way to make sure the element is rendered inside the checkout form?
3. If it comes from how our Checkout layout is built, which element should we change?
Thanks