Commit a56dce8435a for woocommerce

commit a56dce8435a0bccd8ff11cfd941912d8d4d0be4b
Author: ThelmaChido <41231764+Thelmachido@users.noreply.github.com>
Date:   Thu Dec 3 15:07:06 2026 +0100

    Gray out out-of-stock variation options in Add to Cart + Options (#71397)

    * Gray out out-of-stock variation options in Add to Cart + Options

    * Add changelog entry for out-of-stock variation options

    * Check out-of-stock options against the exact selected combination

    * Expose out-of-stock variation options to assistive technology

    Out-of-stock chips now carry a description that is linked with
    aria-describedby to screen-reader text, used as the text chip tooltip,
    and appended to the swatch tooltip, so the state no longer relies on
    hover alone. Renames the unreleased `title` item field to `description`.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    * Keep swatch tooltips for every chip and fix the stock e2e locator

    Swatch blocks decide the tooltip per block again, so swatch items without
    visual data keep their label tooltip. Non-text labels fall back to the
    aria label. The variable product e2e test now reads the stock indicator
    directly, since chips also contain hidden "Out of stock" text.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    * Check the stock indicator is visible in the out-of-stock e2e test

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    * Address review: aria-label for stock status, looks-disabled class

    - Put "out of stock" in the option's aria-label (e.g. "Small, out of
      stock") instead of a new `description` field with aria-describedby
      and screen-reader text. `SelectableItem` now only gains
      `looksDisabled`. The label comes from a translated "%s, out of stock"
      format passed through the interactivity config.
    - Bind aria-label on server-rendered chips so it updates as the shopper
      changes selections. A chip that looks disabled uses its aria-label as
      the tooltip.
    - Rename the `is-disabled` chip class to `looks-disabled`, so it can't
      be confused with the native `disabled` attribute.
    - Restore `isAttributeValueValid()` as on trunk; the out-of-stock check
      has its own matching, so `getMatchingVariations()` isn't needed.
    - Restore the e2e stock assertion as on trunk; it only changed to avoid
      the hidden screen-reader text.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    * Expect the stock status in out-of-stock chip names in e2e tests

    Out-of-stock variation options now include the stock status in their
    accessible name (e.g. "Blue, out of stock"), so tests that locate chips
    by exact name must use it. Updates the Hoodie flow in the Add to Cart +
    Options spec and the Back in Stock form spec, and checks that the
    selected Blue chip is named as out of stock.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    * Merge the chip tooltip getters into one itemTitle

    Swatch chips are detected from item.visual, which every term of a visual
    attribute has, even without a colour or image. Both chip templates now
    bind state.itemTitle.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    * Simplify the out-of-stock variation selector tests

    Rename the helper to getSelectableItems, merge the invalid-option and
    selectable checks into the main out-of-stock test, drop a duplicate test
    and remove an unneeded PHP comment.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    ---------

    Co-authored-by: Thelma  Mutete <thelma@Thelmas-MacBook-Pro.local>
    Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

diff --git a/plugins/woocommerce/changelog/64683-out-of-stock-variations-greyed b/plugins/woocommerce/changelog/64683-out-of-stock-variations-greyed
new file mode 100644
index 00000000000..1c5de6018e4
--- /dev/null
+++ b/plugins/woocommerce/changelog/64683-out-of-stock-variations-greyed
@@ -0,0 +1,4 @@
+Significance: minor
+Type: enhancement
+
+Gray out out-of-stock variation options in the Add to Cart + Options block, while keeping them selectable.
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/frontend.ts
index 1d7edf94455..3c78c081b40 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/frontend.ts
@@ -145,6 +145,70 @@ const isAttributeValueValid = ( {
 	} );
 };

+type AttributeValueCheck = {
+	attributeName: string;
+	attributeValue: string;
+	selectedAttributes: SelectedAttributes[];
+};
+
+/**
+ * Whether every variation with this attribute value and the shopper's other
+ * selected values is out of stock. Unlike the validity check, the other
+ * selections must match exactly, so a selected value is checked against the
+ * current combination. Variations without loaded data aren't out of stock.
+ */
+const isAttributeValueOutOfStock = ( {
+	attributeName,
+	attributeValue,
+	selectedAttributes,
+}: AttributeValueCheck ): boolean => {
+	const { mainProductInContext: product } = productsState;
+
+	if (
+		! attributeName ||
+		! attributeValue ||
+		! Array.isArray( selectedAttributes ) ||
+		! product?.variations?.length
+	) {
+		return false;
+	}
+
+	const otherSelectedAttributes = selectedAttributes.filter(
+		( selectedAttribute ) =>
+			! attributeNamesMatch( selectedAttribute.attribute, attributeName )
+	);
+
+	const matchingVariations = product.variations.filter( ( variation ) => {
+		const variationAttrValue = getVariationAttributeValue(
+			variation,
+			attributeName
+		);
+		if (
+			variationAttrValue !== attributeValue &&
+			variationAttrValue !== null // null is used for "any".
+		) {
+			return false;
+		}
+
+		return otherSelectedAttributes.every( ( selectedAttribute ) => {
+			const value = getVariationAttributeValue(
+				variation,
+				selectedAttribute.attribute
+			);
+			return value === selectedAttribute.value || value === null;
+		} );
+	} );
+
+	return (
+		matchingVariations.length > 0 &&
+		matchingVariations.every(
+			( variation ) =>
+				productsState.productVariations[ variation.id ]?.is_in_stock ===
+				false
+		)
+	);
+};
+
 /**
  * Return the product attributes and options from Store API format.
  *
@@ -230,31 +294,47 @@ const { actions, state } = store< VariableProductAddToCartWithOptionsStore >(
 				} = context;
 				const { selectedAttributes } = state;
 				const hideInvalid = disabledAttributesAction === 'hide';
+				const outOfStockLabel: string =
+					getConfig()?.variationOptionLabels?.outOfStock ?? '';

 				if ( ! Array.isArray( variationAttributeOptions ) ) {
 					return [];
 				}

 				return variationAttributeOptions.map( ( row, index ) => {
-					const disabled = ! isAttributeValueValid( {
+					const check = {
 						attributeName: name,
 						attributeValue: row.value,
 						selectedAttributes,
-					} );
+					};
+					const disabled = ! isAttributeValueValid( check );
+					const outOfStock =
+						! disabled && isAttributeValueOutOfStock( check );
 					const selected = selectedAttributes.some(
 						( attrObject ) =>
 							attributeNamesMatch( attrObject.attribute, name ) &&
 							attrObject.value === row.value
 					);
+					const ariaLabel = row.ariaLabel || row.label;
 					return {
 						id: row.id,
 						label: row.label,
 						value: row.value,
-						ariaLabel: row.ariaLabel || row.label,
+						// The stock status goes in the accessible name, e.g.
+						// "Small, out of stock". A replacer function keeps "$"
+						// in option names literal.
+						ariaLabel:
+							outOfStock && outOfStockLabel
+								? outOfStockLabel.replace(
+										/%(?:1\$)?s/,
+										() => ariaLabel
+									)
+								: ariaLabel,
 						index,
 						selected,
 						disabled,
 						hidden: hideInvalid && disabled,
+						looksDisabled: outOfStock,
 						...( row.visual !== undefined && {
 							visual: row.visual,
 						} ),
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/test/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/test/frontend.ts
index d8576ee6851..e2e7f13d570 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/test/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/test/frontend.ts
@@ -132,6 +132,9 @@ describe( 'Add to Cart + Options variation selector store', () => {
 				variableProductMissingAttributes: 'Choose options.',
 				variableProductOutOfStock: 'Variation unavailable.',
 			},
+			variationOptionLabels: {
+				outOfStock: '%s, out of stock',
+			},
 		} );

 		jest.isolateModules( () => {
@@ -194,6 +197,192 @@ describe( 'Add to Cart + Options variation selector store', () => {
 		}
 	);

+	describe( 'out-of-stock options', () => {
+		const getSelectableItems = (
+			selectedAttributes: SelectedAttributes[]
+		) => {
+			mockProductsState.mainProductInContext = {
+				id: 100,
+				type: 'variable',
+				variations: [
+					variation( 101, [
+						{ name: 'Color', value: 'blue' },
+						{ name: 'Size', value: 's' },
+					] ),
+					variation( 102, [
+						{ name: 'Color', value: 'blue' },
+						{ name: 'Size', value: 'm' },
+					] ),
+					variation( 103, [
+						{ name: 'Color', value: 'red' },
+						{ name: 'Size', value: 's' },
+					] ),
+				],
+			};
+			mockProductsState.productVariations = {
+				101: { id: 101, is_in_stock: false },
+				102: { id: 102, is_in_stock: true },
+				103: { id: 103, is_in_stock: true },
+			};
+			mockContext = {
+				...mockContext,
+				name: 'Size',
+				selectedAttributes,
+				variationAttributeOptions: [
+					{ id: 'size-s', label: 'S', value: 's' },
+					{ id: 'size-m', label: 'M', value: 'm' },
+					{ id: 'size-l', label: 'L', value: 'l' },
+				],
+			};
+
+			return Object.fromEntries(
+				getRegisteredStore().state.selectableItems.map( ( item ) => [
+					item.value,
+					item,
+				] )
+			);
+		};
+
+		it( 'grays out an option whose matching variations are all out of stock, without disabling it', () => {
+			const items = getSelectableItems( [
+				{ attribute: 'attribute_pa_color', value: 'blue' },
+			] );
+
+			expect( items.s ).toMatchObject( {
+				disabled: false,
+				hidden: false,
+				looksDisabled: true,
+				ariaLabel: 'S, out of stock',
+			} );
+			expect( items.m ).toMatchObject( {
+				disabled: false,
+				looksDisabled: false,
+				ariaLabel: 'M',
+			} );
+			expect( items.l ).toMatchObject( {
+				disabled: true,
+				looksDisabled: false,
+				ariaLabel: 'L',
+			} );
+
+			getRegisteredStore().actions.toggle( items.s );
+
+			expect( mockContext.selectedAttributes ).toEqual( [
+				{ attribute: 'attribute_pa_color', value: 'blue' },
+				{ attribute: 'Size', value: 's' },
+			] );
+		} );
+
+		it( 'keeps a selected out-of-stock option grayed out', () => {
+			const items = getSelectableItems( [
+				{ attribute: 'attribute_pa_color', value: 'blue' },
+				{ attribute: 'Size', value: 's' },
+			] );
+
+			expect( items.s ).toMatchObject( {
+				selected: true,
+				disabled: false,
+				looksDisabled: true,
+				ariaLabel: 'S, out of stock',
+			} );
+			expect( items.m ).toMatchObject( {
+				disabled: false,
+				looksDisabled: false,
+			} );
+		} );
+
+		it( 'grays out a value in another attribute when it is out of stock for the selected option', () => {
+			getSelectableItems( [
+				{ attribute: 'attribute_pa_color', value: 'blue' },
+				{ attribute: 'Size', value: 's' },
+			] );
+			mockContext = {
+				...mockContext,
+				name: 'Color',
+				variationAttributeOptions: [
+					{ id: 'color-blue', label: 'Blue', value: 'blue' },
+					{ id: 'color-red', label: 'Red', value: 'red' },
+				],
+			};
+
+			const items = Object.fromEntries(
+				getRegisteredStore().state.selectableItems.map( ( item ) => [
+					item.value,
+					item,
+				] )
+			);
+
+			expect( items.blue ).toMatchObject( {
+				selected: true,
+				disabled: false,
+				looksDisabled: true,
+			} );
+			expect( items.red ).toMatchObject( {
+				disabled: false,
+				looksDisabled: false,
+			} );
+		} );
+
+		it( 'shows out-of-stock options when invalid options are hidden', () => {
+			mockContext = { ...mockContext, disabledAttributesAction: 'hide' };
+			const items = getSelectableItems( [
+				{ attribute: 'attribute_pa_color', value: 'blue' },
+			] );
+
+			expect( items.s ).toMatchObject( {
+				disabled: false,
+				hidden: false,
+				looksDisabled: true,
+			} );
+			expect( items.l ).toMatchObject( {
+				disabled: true,
+				hidden: true,
+				looksDisabled: false,
+			} );
+		} );
+
+		it( 'does not gray out an option when the variation data is not loaded', () => {
+			getSelectableItems( [
+				{ attribute: 'attribute_pa_color', value: 'blue' },
+			] );
+			mockProductsState.productVariations = {};
+
+			expect(
+				getRegisteredStore().state.selectableItems.find(
+					( item ) => item.value === 's'
+				)
+			).toMatchObject( { disabled: false, looksDisabled: false } );
+		} );
+
+		it( 'builds the out-of-stock aria label from a translated format', () => {
+			mockGetConfig.mockReturnValue( {
+				errorMessages: {},
+				variationOptionLabels: { outOfStock: 'Agotado: %1$s' },
+			} );
+			const items = getSelectableItems( [
+				{ attribute: 'attribute_pa_color', value: 'blue' },
+			] );
+
+			expect( items.s.ariaLabel ).toBe( 'Agotado: S' );
+		} );
+
+		it( 'keeps "$" in option names literal in the aria label', () => {
+			getSelectableItems( [
+				{ attribute: 'attribute_pa_color', value: 'blue' },
+			] );
+			mockContext = {
+				...mockContext,
+				variationAttributeOptions: [
+					{ id: 'size-s', label: '$& S', value: 's' },
+				],
+			};
+
+			expect(
+				getRegisteredStore().state.selectableItems[ 0 ].ariaLabel
+			).toBe( '$& S, out of stock' );
+		} );
+	} );
+
 	it( 'preserves a custom attribute slug while matching its Store API label', () => {
 		mockProductsState.mainProductInContext = {
 			id: 100,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/__tests__/frontend.test.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/__tests__/frontend.test.ts
index f5d1ae8117a..9b2c8c7cbf9 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/__tests__/frontend.test.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/__tests__/frontend.test.ts
@@ -156,6 +156,76 @@ describe( 'product filter chips interactivity store', () => {
 		expect( mockParentToggle ).not.toHaveBeenCalled();
 	} );

+	describe( 'item tooltip', () => {
+		const getState = ( item?: Record< string, unknown > ) => {
+			if ( ! mockRegisteredStore ) {
+				throw new Error( 'Chips store was not registered.' );
+			}
+			mockGetContext.mockReturnValue( { item } );
+			return mockRegisteredStore.state;
+		};
+
+		const textItem = { id: 'size-s', label: 'S', value: 's' };
+		const swatchItem = {
+			id: 'color-blue',
+			label: 'Blue',
+			value: 'blue',
+			visual: { color: '#0000ff' },
+		};
+
+		it( 'uses the aria label as the tooltip for text chips that look disabled', () => {
+			const state = getState( {
+				...textItem,
+				ariaLabel: 'S, out of stock',
+				looksDisabled: true,
+			} );
+
+			expect( state.itemTitle ).toBe( 'S, out of stock' );
+		} );
+
+		it( 'uses the aria label as the tooltip for swatches that look disabled', () => {
+			const state = getState( {
+				...swatchItem,
+				ariaLabel: 'Blue, out of stock',
+				looksDisabled: true,
+			} );
+
+			expect( state.itemTitle ).toBe( 'Blue, out of stock' );
+		} );
+
+		it( 'leaves text chips without a tooltip by default', () => {
+			expect(
+				getState( { ...textItem, ariaLabel: 'S' } ).itemTitle
+			).toBeUndefined();
+		} );
+
+		it( 'keeps the label tooltip on swatches by default', () => {
+			expect(
+				getState( { ...swatchItem, ariaLabel: 'Blue (3 products)' } )
+					.itemTitle
+			).toBe( 'Blue' );
+		} );
+
+		it( 'keeps the label tooltip on swatches without a colour or image', () => {
+			expect(
+				getState( {
+					...swatchItem,
+					visual: { type: 'none', value: '' },
+				} ).itemTitle
+			).toBe( 'Blue' );
+		} );
+
+		it( 'uses the aria label as swatch tooltip when the label is not text', () => {
+			const state = getState( {
+				...swatchItem,
+				label: { type: 'span' },
+				ariaLabel: 'Blue',
+			} );
+
+			expect( state.itemTitle ).toBe( 'Blue' );
+		} );
+	} );
+
 	it( 'sets chip CSS variables when not already defined', () => {
 		if ( ! mockRegisteredStore ) {
 			throw new Error( 'Chips store was not registered.' );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/frontend.ts
index 9f49795118d..fe01beaa07b 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/frontend.ts
@@ -35,6 +35,7 @@ type ChipsContext = {
 type ChipsStore = {
 	state: {
 		items: ChipsItem[];
+		itemTitle: string | undefined;
 		swatchHidden: boolean;
 		swatchStyle: string;
 	};
@@ -118,6 +119,22 @@ const { state }: ChipsStore = store< ChipsStore >(
 							index >= normalizedDisplayLimit ),
 				} ) );
 			},
+			get itemTitle(): string | undefined {
+				const item = getCurrentItem();
+				if ( ! item ) {
+					return undefined;
+				}
+				if ( item.looksDisabled && item.ariaLabel ) {
+					return item.ariaLabel;
+				}
+				if ( item.visual ) {
+					// Swatch text is visually hidden, so the tooltip names the option.
+					return typeof item.label === 'string'
+						? item.label
+						: item.ariaLabel;
+				}
+				return undefined;
+			},
 			get swatchHidden(): boolean {
 				const item = getCurrentItem();
 				return isVisualAttributeTermEmpty( item?.visual );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/style.scss b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/style.scss
index bfc66705729..5013c21637d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/style.scss
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/style.scss
@@ -78,6 +78,11 @@
 	}
 }

+// Looks unavailable but stays clickable, e.g. an out-of-stock variation.
+.wc-block-product-filter-chips__item.looks-disabled {
+	opacity: 0.5;
+}
+
 :where(.wc-block-product-filter-chips__label) {
 	display: inline-flex;
 	align-items: center;
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/selectable-items.ts b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/selectable-items.ts
index 39533c5aaf1..40bc80d2869 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/selectable-items.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/selectable-items.ts
@@ -12,6 +12,11 @@ export type SelectableItem< T = unknown > = (
 	selected?: boolean;
 	disabled?: boolean;
 	hidden?: boolean;
+	/**
+	 * Show the item as unavailable while keeping it selectable, unlike
+	 * `disabled`. Put the reason in `ariaLabel`, e.g. "Small, out of stock".
+	 */
+	looksDisabled?: boolean;
 	type?: string;
 } & T;

diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php b/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php
index 3cfe6634ccb..b5b96c22aa8 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypes/AddToCartWithOptions/AddToCartWithOptions.php
@@ -264,7 +264,7 @@ class AddToCartWithOptions extends AbstractBlock {
 			wp_interactivity_config(
 				'woocommerce/add-to-cart-with-options',
 				array(
-					'errorMessages' => array(
+					'errorMessages'         => array(
 						'invalidQuantities'                => esc_html__(
 							'Please select a valid quantity to add to the cart.',
 							'woocommerce'
@@ -286,6 +286,10 @@ class AddToCartWithOptions extends AbstractBlock {
 							$product->get_name()
 						),
 					),
+					'variationOptionLabels' => array(
+						/* translators: %s: variation option name, e.g. "Blue" or "Small". */
+						'outOfStock' => __( '%s, out of stock', 'woocommerce' ),
+					),
 				)
 			);

diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterChips.php b/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterChips.php
index 7dfeb4ab027..e7407523ffd 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterChips.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypes/ProductFilterChips.php
@@ -134,9 +134,17 @@ final class ProductFilterChips extends AbstractBlock {
 				<div class="wc-block-product-filter-chips__items">
 					<?php
 					foreach ( $visible_items as $item ) :
+						$item_looks_disabled = ! empty( $item['looksDisabled'] );
+						if ( $item_looks_disabled && ! empty( $item['ariaLabel'] ) ) {
+							$item_title = $item['ariaLabel'];
+						} elseif ( $has_visual_swatches ) {
+							$item_title = $item['label'];
+						} else {
+							$item_title = '';
+						}
 						?>
 						<button
-							class="wc-block-product-filter-chips__item <?php echo esc_attr( $item_classes_and_styles['classnames'] ); ?>"
+							class="wc-block-product-filter-chips__item <?php echo esc_attr( $item_classes_and_styles['classnames'] ); ?><?php echo $item_looks_disabled ? ' looks-disabled' : ''; ?>"
 							<?php if ( $item_classes_and_styles['css'] ) : ?>
 								style="<?php echo esc_attr( $item_classes_and_styles['css'] ); ?>"
 							<?php endif; ?>
@@ -146,8 +154,8 @@ final class ProductFilterChips extends AbstractBlock {
 							<?php if ( ! empty( $item['ariaLabel'] ) ) : ?>
 								aria-label="<?php echo esc_attr( $item['ariaLabel'] ); ?>"
 							<?php endif; ?>
-							<?php if ( $has_visual_swatches ) : ?>
-								title="<?php echo esc_attr( $item['label'] ); ?>"
+							<?php if ( '' !== $item_title ) : ?>
+								title="<?php echo esc_attr( $item_title ); ?>"
 							<?php endif; ?>
 							value="<?php echo esc_attr( $item['value'] ); ?>"
 							aria-checked="<?php echo ! empty( $item['selected'] ) ? 'true' : 'false'; ?>"
@@ -155,6 +163,9 @@ final class ProductFilterChips extends AbstractBlock {
 							data-wp-each-child
 							<?php echo wp_interactivity_data_wp_context( array( 'item' => $item ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
 							data-wp-bind--aria-checked="context.item.selected"
+							data-wp-bind--aria-label="context.item.ariaLabel"
+							data-wp-bind--title="state.itemTitle"
+							data-wp-class--looks-disabled="context.item.looksDisabled"
 							data-wp-bind--disabled="context.item.disabled"
 							data-wp-bind--hidden="context.item.hidden"
 							data-wp-on--click="actions.toggle"
@@ -197,11 +208,10 @@ final class ProductFilterChips extends AbstractBlock {
 							role="<?php echo esc_attr( $button_role ); ?>"
 							data-wp-bind--id="context.item.id"
 							data-wp-bind--aria-label="context.item.ariaLabel"
-							<?php if ( $has_visual_swatches ) : ?>
-								data-wp-bind--title="context.item.label"
-							<?php endif; ?>
+							data-wp-bind--title="state.itemTitle"
 							data-wp-bind--value="context.item.value"
 							data-wp-bind--aria-checked="context.item.selected"
+							data-wp-class--looks-disabled="context.item.looksDisabled"
 							data-wp-bind--disabled="context.item.disabled"
 							data-wp-bind--hidden="context.item.hidden"
 							data-wp-on--click="actions.toggle"
diff --git a/plugins/woocommerce/tests/e2e/tests/blocks/add-to-cart-with-options/add-to-cart-with-options.block_theme.spec.ts b/plugins/woocommerce/tests/e2e/tests/blocks/add-to-cart-with-options/add-to-cart-with-options.block_theme.spec.ts
index 89e474bb4a5..04edcb6b2df 100644
--- a/plugins/woocommerce/tests/e2e/tests/blocks/add-to-cart-with-options/add-to-cart-with-options.block_theme.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/blocks/add-to-cart-with-options/add-to-cart-with-options.block_theme.spec.ts
@@ -209,9 +209,6 @@ test.describe( 'Add to Cart + Options Block', () => {
 		const addToCartBlock = page.locator(
 			'.wp-block-add-to-cart-with-options'
 		);
-		const logoNoOption = addToCartBlock
-			.getByRole( 'radiogroup', { name: 'Logo' } )
-			.getByRole( 'radio', { name: 'No', exact: true } );
 		const colorBlueOption = addToCartBlock
 			.getByRole( 'radiogroup', { name: 'Color' } )
 			.getByRole( 'radio', { name: 'Blue', exact: true } );
@@ -221,6 +218,15 @@ test.describe( 'Add to Cart + Options Block', () => {
 		const colorRedOption = addToCartBlock
 			.getByRole( 'radiogroup', { name: 'Color' } )
 			.getByRole( 'radio', { name: 'Red', exact: true } );
+		// Out-of-stock options add the stock status to their accessible name.
+		// "Hoodie - Blue, No" is out of stock, so once one of Blue and No is
+		// selected, the other is named "…, out of stock".
+		const logoNoOutOfStockOption = addToCartBlock
+			.getByRole( 'radiogroup', { name: 'Logo' } )
+			.getByRole( 'radio', { name: 'No, out of stock', exact: true } );
+		const colorBlueOutOfStockOption = addToCartBlock
+			.getByRole( 'radiogroup', { name: 'Color' } )
+			.getByRole( 'radio', { name: 'Blue, out of stock', exact: true } );
 		// We use the Add to Cart + Options class to make sure we don't select
 		// the Add to Cart button from the Related Products block.
 		const addToCartButton = page
@@ -332,8 +338,9 @@ test.describe( 'Add to Cart + Options Block', () => {
 			expect( visibleImage ).toBe( '34' );

 			await colorBlueOption.click();
-			await logoNoOption.click();
+			await logoNoOutOfStockOption.click();

+			await expect( colorBlueOutOfStockOption ).toBeChecked();
 			await expect( productPrice ).toHaveText( '$45.00' );
 			await expect( page.getByText( 'Out of stock' ) ).toBeVisible();
 			await expect( addToCartButton ).toBeHidden();
@@ -356,7 +363,7 @@ test.describe( 'Add to Cart + Options Block', () => {
 		} );

 		await test.step( 'resets blocks rendering variation data when attributes are deselected', async () => {
-			await colorBlueOption.click();
+			await colorBlueOutOfStockOption.click();

 			await expect( productPrice ).toHaveText( /\$42.00 – \$45.00.*/ );
 			await expect( page.getByText( '100 in stock' ) ).toBeVisible();
diff --git a/plugins/woocommerce/tests/e2e/tests/blocks/add-to-cart-with-options/back-in-stock-form.block_theme.spec.ts b/plugins/woocommerce/tests/e2e/tests/blocks/add-to-cart-with-options/back-in-stock-form.block_theme.spec.ts
index 3bd9fab9420..b8d78e646fb 100644
--- a/plugins/woocommerce/tests/e2e/tests/blocks/add-to-cart-with-options/back-in-stock-form.block_theme.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/blocks/add-to-cart-with-options/back-in-stock-form.block_theme.spec.ts
@@ -135,6 +135,8 @@ test.describe( 'Add to Cart + Options Block: Back in Stock form', () => {
 			outOfStockVariationId = create[ 0 ].id;
 		} );

+		// Blue is out of stock for every size, so its chips, and the size
+		// chips once Blue is selected, add the stock status to their name.
 		const chip = ( page: Page, attribute: string, option: string ) =>
 			page
 				.locator( '.wp-block-add-to-cart-with-options' )
@@ -150,8 +152,8 @@ test.describe( 'Add to Cart + Options Block: Back in Stock form', () => {
 			await page.goto( product.permalink );
 			await expect( form ).toBeHidden();

-			await chip( page, 'Color', 'Blue' ).click();
-			await chip( page, 'Size', 'Large' ).click();
+			await chip( page, 'Color', 'Blue, out of stock' ).click();
+			await chip( page, 'Size', 'Large, out of stock' ).click();

 			await expect( form ).toBeVisible();
 			await expect( bisTargetProductInput( page ) ).toHaveValue(
@@ -189,18 +191,18 @@ test.describe( 'Add to Cart + Options Block: Back in Stock form', () => {
 			const form = bisFormLocator( page );

 			await page.goto( product.permalink );
-			await chip( page, 'Color', 'Blue' ).click();
-			await chip( page, 'Size', 'Large' ).click();
+			await chip( page, 'Color', 'Blue, out of stock' ).click();
+			await chip( page, 'Size', 'Large, out of stock' ).click();
 			await expect( form ).toBeVisible();

 			await chip( page, 'Color', 'Red' ).click();
 			await expect( form ).toBeHidden();

-			await chip( page, 'Color', 'Blue' ).click();
+			await chip( page, 'Color', 'Blue, out of stock' ).click();
 			await expect( form ).toBeVisible();

 			// Clicking the selected chip clears it.
-			await chip( page, 'Size', 'Large' ).click();
+			await chip( page, 'Size', 'Large, out of stock' ).click();
 			await expect( form ).toBeHidden();
 			await expect( bisTargetProductInput( page ) ).toHaveValue(
 				String( product.id )