Commit d4600233b44 for woocommerce

commit d4600233b44b206ddf16ee48c0d3544ea9d7c880
Author: Dat Hoang <htdat@users.noreply.github.com>
Date:   Fri Sep 4 16:12:04 2026 +0700

    Move tokenization form script to footer with defer strategy (#68036)

diff --git a/plugins/woocommerce/changelog/68036-woopmnt-6354-tokenization-form-footer b/plugins/woocommerce/changelog/68036-woopmnt-6354-tokenization-form-footer
new file mode 100644
index 00000000000..fd786269be5
--- /dev/null
+++ b/plugins/woocommerce/changelog/68036-woopmnt-6354-tokenization-form-footer
@@ -0,0 +1,4 @@
+Significance: patch
+Type: performance
+
+Load `woocommerce-tokenization-form` in the footer with a `defer` strategy so the script no longer sits in the blocking `<head>` on checkout pages.
diff --git a/plugins/woocommerce/client/legacy/js/frontend/tokenization-form.js b/plugins/woocommerce/client/legacy/js/frontend/tokenization-form.js
index 23fe862069f..c204f6c7870 100644
--- a/plugins/woocommerce/client/legacy/js/frontend/tokenization-form.js
+++ b/plugins/woocommerce/client/legacy/js/frontend/tokenization-form.js
@@ -1,5 +1,5 @@
 /*global wc_tokenization_form_params */
-jQuery( function( $ ) {
+( function( $ ) {

 	/**
 	 * WCTokenizationForm class.
@@ -105,6 +105,12 @@ jQuery( function( $ ) {

 	/**
 	 * Initialize.
+	 *
+	 * Register the listener synchronously (outside jQuery(fn)) so it is bound before
+	 * any DOM-ready callback runs. With this script loaded in the footer with a
+	 * defer strategy, wc-credit-card-form-init is fired from another script's
+	 * DOM-ready callback and would otherwise be missed if we deferred registration
+	 * until our own DOM-ready callback ran later in the queue.
 	 */
 	$( document.body ).on( 'updated_checkout wc-credit-card-form-init', function() {
 		// Loop over gateways with saved payment methods
@@ -114,4 +120,4 @@ jQuery( function( $ ) {
 			$( this ).wc_tokenization_form();
 		} );
 	} );
-} );
+} )( jQuery );
diff --git a/plugins/woocommerce/includes/abstracts/abstract-wc-payment-gateway.php b/plugins/woocommerce/includes/abstracts/abstract-wc-payment-gateway.php
index 5ed2e4394e2..710483e400b 100644
--- a/plugins/woocommerce/includes/abstracts/abstract-wc-payment-gateway.php
+++ b/plugins/woocommerce/includes/abstracts/abstract-wc-payment-gateway.php
@@ -566,7 +566,10 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
 			plugins_url( '/assets/js/frontend/tokenization-form' . ( Constants::is_true( 'SCRIPT_DEBUG' ) ? '' : '.min' ) . '.js', WC_PLUGIN_FILE ),
 			array( 'jquery' ),
 			WC()->version,
-			false
+			array(
+				'in_footer' => true,
+				'strategy'  => 'defer',
+			)
 		);

 		wp_localize_script(