Commit ddeb6cf774 for woocommerce
commit ddeb6cf774d56f1529382d4e2b551a0e0cc896a3
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date: Fri Feb 13 13:48:53 2026 +0100
Add to Cart + Options: add default margin between inner elements (#63220)
* Add to Cart + Options: add default margin between inner elements
* Add changelog file
diff --git a/plugins/woocommerce/changelog/fix-63217-add-to-cart-with-options-default-margin b/plugins/woocommerce/changelog/fix-63217-add-to-cart-with-options-default-margin
new file mode 100644
index 0000000000..2a6d1184c3
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-63217-add-to-cart-with-options-default-margin
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Add to Cart + Options: add default margin between inner elements
diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php b/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php
index a3217061ec..1f83ffe1a4 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php
@@ -573,6 +573,15 @@ class AddToCartWithOptions extends AbstractBlock {
array(
isset( $wrapper_attributes['class'] ) ? $wrapper_attributes['class'] : '',
isset( $form_attributes['class'] ) ? $form_attributes['class'] : '',
+ // Add the `is-layout-flow` class so inner elements automatically get the
+ // default vertical margin from the theme. That's especially useful for
+ // elements added by extensions like express payment method buttons.
+ // In the future, we want to use `supports.layout` in block.json instead
+ // of hardcoding the class here. However, right now that wouldn't work
+ // because the wrapper element of the block is the notices `<div>`, so the
+ // `is-layout-flow` class would be applied to the notices container instead
+ // of the `<form>` as we want.
+ 'is-layout-flow',
)
)
),