Commit b996e04bfbf for woocommerce
commit b996e04bfbfd90e88b0e2e15a6abadc7516d26d2
Author: Luigi Teschio <gigitux@gmail.com>
Date: Tue Sep 1 12:28:32 2026 +0200
Fix extension markup breaking variable add-to-cart forms (#68213)
* Add changelog entry for variation gallery markup fix
* Fix extension markup in variation gallery snapshots
diff --git a/plugins/woocommerce/changelog/fix-variation-gallery-extension-markup b/plugins/woocommerce/changelog/fix-variation-gallery-extension-markup
new file mode 100644
index 00000000000..b4fb5ab198f
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-variation-gallery-extension-markup
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Prevent extension gallery markup from breaking variable product add-to-cart forms.
diff --git a/plugins/woocommerce/templates/single-product/add-to-cart/variable.php b/plugins/woocommerce/templates/single-product/add-to-cart/variable.php
index 9589427ed39..4b90434d29b 100644
--- a/plugins/woocommerce/templates/single-product/add-to-cart/variable.php
+++ b/plugins/woocommerce/templates/single-product/add-to-cart/variable.php
@@ -63,7 +63,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
<?php
// Reset snapshot for cases where a theme/plugin loads the variation form later, like quick-view modals.
?>
- <script type="text/template" class="wc-product-gallery-default-template"><?php echo wc_get_product_gallery_html( $product ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></script>
+ <template class="wc-product-gallery-default-template"><?php echo wc_get_product_gallery_html( $product ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></template>
<?php do_action( 'woocommerce_after_variations_table' ); ?>
<div class="single_variation_wrap">