Commit ae36982fe53 for woocommerce
commit ae36982fe5343a6ed59419fe7a75af6a69b98ee7
Author: Mario Santos <34552881+SantosGuillamot@users.noreply.github.com>
Date: Thu Nov 19 13:59:50 2026 +0100
Serve the woocommerce Interactivity API store from @woocommerce/stores/woocommerce (#69800)
* Serve the woocommerce store from @woocommerce/stores/woocommerce
* Wait for the store nonce in the module id e2e spec
* Match the removed module id by pattern in the module id e2e spec
* Add a type check declaration importing the cart types from the woocommerce store module id
* Require the Mini-Cart block on the page the cart store module id test loads
* Name the woocommerce store and its @woocommerce/stores/woocommerce module in the stores README
* Add changelog entries for the woocommerce store module id
* Name the changelog entries after the branch
* Remove the module id type-check file and e2e spec
* Move new imports to the @woocommerce/stores/woocommerce module id
Trunk's #70714 added an import of the removed
@woocommerce/stores/woocommerce/cart id to the mutation batcher rollback
e2e test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Use a type-only import for SelectedAttributes in the variation selector
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
diff --git a/plugins/woocommerce/changelog/wooplug-7779-woocommerce-store-module-id b/plugins/woocommerce/changelog/wooplug-7779-woocommerce-store-module-id
new file mode 100644
index 00000000000..dd97f2a14b7
--- /dev/null
+++ b/plugins/woocommerce/changelog/wooplug-7779-woocommerce-store-module-id
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Load the `woocommerce` Interactivity API store from the `@woocommerce/stores/woocommerce` script module, which replaces `@woocommerce/stores/woocommerce/cart`.
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/README.md b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/README.md
index d29b2d62164..7dba7746dc0 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/README.md
+++ b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/README.md
@@ -5,7 +5,7 @@ This folder contains the Interactivity API (iAPI) stores that WooCommerce blocks
Stores in this folder:
- [`woocommerce/products`](#woocommerceproducts-store) — server-populated cache of product and variation data in Store API format.
-- [`woocommerce/cart`](#woocommercecart-store) — cart state and actions (with mutation batching for performance). `addCartItem` resolves with a structured per-call outcome (`AddCartItemOutcome`) instead of `void`, and the store's cross-cutting side effects (sync event, legacy event, screen-reader announcement) fire exactly once per batch cycle, not once per request — see below.
+- [`woocommerce`](#woocommerce-store) — loaded from the `@woocommerce/stores/woocommerce` script module; cart state and actions (with mutation batching for performance). `addCartItem` resolves with a structured per-call outcome (`AddCartItemOutcome`) instead of `void`, and the store's cross-cutting side effects (sync event, legacy event, screen-reader announcement) fire exactly once per batch cycle, not once per request — see below.
---
@@ -235,9 +235,9 @@ For variable products, `findProduct` returns `null` when no variation matches th
---
-## `woocommerce/cart` store
+## `woocommerce` store
-The `woocommerce` Interactivity API store (`base/stores/woocommerce/cart.ts`) holds cart state and actions, with mutation batching for performance. This section covers the `addCartItem` outcome contract and the once-per-cycle cross-cutting side effects below — it is not a write-up of the store's full state shape, its other actions, or the rest of the mutation batcher's internals.
+The `woocommerce` Interactivity API store (`base/stores/woocommerce/cart.ts`) is served as the script module `@woocommerce/stores/woocommerce`, and blocks load it from that id. It holds cart state and actions, with mutation batching for performance. This section covers the `addCartItem` outcome contract and the once-per-cycle cross-cutting side effects below — it is not a write-up of the store's full state shape, its other actions, or the rest of the mutation batcher's internals.
### The `addCartItem` outcome contract
@@ -257,10 +257,10 @@ export type AddCartItemOutcome =
| { success: false; error: AddCartItemError };
```
-Both types are exported from the cart store module and reach consumers through the existing type-only import path:
+Both types are exported from the `woocommerce` store's module, `@woocommerce/stores/woocommerce`, and reach consumers through a type-only import:
```ts
-import type { AddCartItemOutcome } from '@woocommerce/stores/woocommerce/cart';
+import type { AddCartItemOutcome } from '@woocommerce/stores/woocommerce';
```
**`addCartItem` stays fire-and-forget.** It never rejects because of a request or server failure — every request path, whether the Store API accepts or rejects it, resolves with an outcome instead of throwing. The action still throws synchronously for its two programmer-error guards (both `quantity` and `quantityToAdd` supplied together, or a keyless call — no `key` — that passes an absolute `quantity` instead of a `quantityToAdd` delta) — those are argument-validation bugs, unrelated to the request outcome below.
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/products.ts b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/products.ts
index 8389a19e286..8cdc412bf13 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/products.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/products.ts
@@ -3,7 +3,7 @@
*/
import { store, getContext } from '@wordpress/interactivity';
import type { ProductResponseItem } from '@woocommerce/types';
-import type { SelectedAttributes } from '@woocommerce/stores/woocommerce/cart';
+import type { SelectedAttributes } from '@woocommerce/stores/woocommerce';
/**
* Per-element selection for the current product/variation.
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/utils/variations/does-cart-item-match-attributes.ts b/plugins/woocommerce/client/blocks/assets/js/base/utils/variations/does-cart-item-match-attributes.ts
index 8e4ba562254..43f06169e1e 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/utils/variations/does-cart-item-match-attributes.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/utils/variations/does-cart-item-match-attributes.ts
@@ -5,7 +5,7 @@ import { store } from '@wordpress/interactivity';
import type {
OptimisticCartItem,
SelectedAttributes,
-} from '@woocommerce/stores/woocommerce/cart';
+} from '@woocommerce/stores/woocommerce';
import '@woocommerce/stores/woocommerce/products';
import type { ProductsStore } from '@woocommerce/stores/woocommerce/products';
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/frontend.ts
index 9503e424545..d9899f42b0d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/frontend.ts
@@ -10,7 +10,7 @@ import {
import type {
Store as WooCommerce,
SelectedAttributes,
-} from '@woocommerce/stores/woocommerce/cart';
+} from '@woocommerce/stores/woocommerce';
import type { Store as StoreNotices } from '@woocommerce/stores/store-notices';
import '@woocommerce/stores/woocommerce/products';
import type { ProductsStore } from '@woocommerce/stores/woocommerce/products';
@@ -282,7 +282,7 @@ const { actions } = store< MergedAddToCartWithOptionsStores >(
// Todo: Use the module exports instead of `store()` once the
// woocommerce store is public.
- yield import( '@woocommerce/stores/woocommerce/cart' );
+ yield import( '@woocommerce/stores/woocommerce' );
const product = productsState.productInContext;
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/frontend.ts
index 132e6011de1..e923a28d534 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/frontend.ts
@@ -5,7 +5,7 @@ import { store, getContext, getConfig } from '@wordpress/interactivity';
import type {
ClientCartItem,
Store as WooCommerce,
-} from '@woocommerce/stores/woocommerce/cart';
+} from '@woocommerce/stores/woocommerce';
import '@woocommerce/stores/woocommerce/products';
import type { ProductsStore } from '@woocommerce/stores/woocommerce/products';
@@ -92,7 +92,7 @@ const { actions } = store< GroupedProductAddToCartWithOptionsStore >(
*batchAddToCart() {
// Todo: Use the module exports instead of `store()` once the
// woocommerce store is public.
- yield import( '@woocommerce/stores/woocommerce/cart' );
+ yield import( '@woocommerce/stores/woocommerce' );
const { quantity, selectedAttributes, groupedProductIds } =
getContext< AddToCartWithOptionsStoreContext >();
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/test/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/test/frontend.ts
index 2fc82779cea..7d0e64a7ac1 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/test/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/test/frontend.ts
@@ -54,7 +54,7 @@ jest.mock(
{ virtual: true }
);
-jest.mock( '@woocommerce/stores/woocommerce/cart', () => ( {} ) );
+jest.mock( '@woocommerce/stores/woocommerce', () => ( {} ) );
jest.mock( '@woocommerce/stores/woocommerce/products', () => ( {} ) );
const getRegisteredStore = (): GroupedProductAddToCartWithOptionsStore => {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/test/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/test/frontend.ts
index ef7cc574751..d68635078f8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/test/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/test/frontend.ts
@@ -82,7 +82,7 @@ jest.mock(
{ virtual: true }
);
-jest.mock( '@woocommerce/stores/woocommerce/cart', () => ( {} ) );
+jest.mock( '@woocommerce/stores/woocommerce', () => ( {} ) );
jest.mock( '@woocommerce/stores/woocommerce/products', () => ( {} ) );
jest.mock( '@woocommerce/stores/store-notices', () => ( {} ) );
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 3b2ae95dcae..1d7edf94455 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
@@ -7,7 +7,7 @@ import {
getConfig,
getElement,
} from '@wordpress/interactivity';
-import { SelectedAttributes } from '@woocommerce/stores/woocommerce/cart';
+import type { SelectedAttributes } from '@woocommerce/stores/woocommerce';
import '@woocommerce/stores/woocommerce/products';
import type { ProductsStore } from '@woocommerce/stores/woocommerce/products';
import type { ProductResponseItem, SelectableItem } from '@woocommerce/types';
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 449b34cd73c..d8576ee6851 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
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
-import type { SelectedAttributes } from '@woocommerce/stores/woocommerce/cart';
+import type { SelectedAttributes } from '@woocommerce/stores/woocommerce';
/**
* Internal dependencies
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-wishlist-button/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-wishlist-button/frontend.ts
index 1c639be4d9a..18cb20bba86 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-wishlist-button/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-wishlist-button/frontend.ts
@@ -10,7 +10,7 @@ import {
import '@woocommerce/stores/woocommerce/products';
import '@woocommerce/stores/woocommerce/shopper-lists';
import type { ProductsStore } from '@woocommerce/stores/woocommerce/products';
-import type { SelectedAttributes } from '@woocommerce/stores/woocommerce/cart';
+import type { SelectedAttributes } from '@woocommerce/stores/woocommerce';
import type {
RawShopperListItem,
Store as ShopperListsStore,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/frontend.ts
index 1a4b4deb628..dcd77af6d26 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/frontend.ts
@@ -10,12 +10,12 @@ import {
useRef,
withSyncEvent,
} from '@wordpress/interactivity';
-import '@woocommerce/stores/woocommerce/cart';
+import '@woocommerce/stores/woocommerce';
import '@woocommerce/stores/store-notices';
import type {
Store as WooCommerce,
WooCommerceConfig,
-} from '@woocommerce/stores/woocommerce/cart';
+} from '@woocommerce/stores/woocommerce';
import {
formatPriceWithCurrency,
normalizeCurrencyResponse,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/cart-reference-frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/cart-reference-frontend.ts
index 3b493e8a0d0..e38b81f49a0 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/cart-reference-frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/cart-reference-frontend.ts
@@ -16,8 +16,8 @@
* External dependencies
*/
import { store, getConfig } from '@wordpress/interactivity';
-import '@woocommerce/stores/woocommerce/cart';
-import type { Store as WooCommerce } from '@woocommerce/stores/woocommerce/cart';
+import '@woocommerce/stores/woocommerce';
+import type { Store as WooCommerce } from '@woocommerce/stores/woocommerce';
/**
* Internal dependencies
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/test/cart-reference-frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/test/cart-reference-frontend.ts
index 9f815a0c8ea..bbc32541154 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/test/cart-reference-frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/test/cart-reference-frontend.ts
@@ -6,7 +6,7 @@ const mockNavigate = jest.fn();
const mockGetConfig = jest.fn();
let mockRefresh: () => Generator;
-jest.mock( '@woocommerce/stores/woocommerce/cart', () => ( {} ) );
+jest.mock( '@woocommerce/stores/woocommerce', () => ( {} ) );
jest.mock( '@wordpress/interactivity', () => ( {
getConfig: mockGetConfig,
store: (
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/frontend.ts
index 07b1b7bf6f0..774ad1a0fcf 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/frontend.ts
@@ -3,7 +3,7 @@
*/
import { store, getContext, useLayoutEffect } from '@wordpress/interactivity';
import '@woocommerce/stores/woocommerce/products';
-import type { Store as WooCommerce } from '@woocommerce/stores/woocommerce/cart';
+import type { Store as WooCommerce } from '@woocommerce/stores/woocommerce';
import type { ProductsStore } from '@woocommerce/stores/woocommerce/products';
/**
@@ -167,7 +167,7 @@ const productButtonStore = {
// Todo: Use the module exports instead of `store()` once the
// woocommerce store is public.
- yield import( '@woocommerce/stores/woocommerce/cart' );
+ yield import( '@woocommerce/stores/woocommerce' );
const { actions } = store< WooCommerce >(
'woocommerce',
@@ -195,7 +195,7 @@ const productButtonStore = {
*refreshCartItems() {
// Todo: Use the module exports instead of `store()` once the
// woocommerce store is public.
- yield import( '@woocommerce/stores/woocommerce/cart' );
+ yield import( '@woocommerce/stores/woocommerce' );
const { actions } = store< WooCommerce >(
'woocommerce',
{},
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/test/utils.test.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/test/utils.test.ts
index d3c57cefc76..d9ce1d545b6 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/test/utils.test.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/test/utils.test.ts
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
-import type { OptimisticCartItem } from '@woocommerce/stores/woocommerce/cart';
+import type { OptimisticCartItem } from '@woocommerce/stores/woocommerce';
/**
* Internal dependencies
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/utils.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/utils.ts
index f13cf733eda..f190b8c5966 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/utils.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/utils.ts
@@ -5,7 +5,7 @@ import type { CartItem } from '@woocommerce/types';
import type {
OptimisticCartItem,
SelectedAttributes,
-} from '@woocommerce/stores/woocommerce/cart';
+} from '@woocommerce/stores/woocommerce';
/**
* Internal dependencies
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/types.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/types.ts
index 5c822416cc4..9249053aa70 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/types.ts
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
-import type { WooCommerceConfig } from '@woocommerce/stores/woocommerce/cart';
+import type { WooCommerceConfig } from '@woocommerce/stores/woocommerce';
export interface ProductGalleryBlockAttributes {
hoverZoom: boolean;
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/frontend.ts
index 0035f4ca618..01469d346ba 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/frontend.ts
@@ -9,7 +9,7 @@ import {
type AsyncAction,
} from '@wordpress/interactivity';
import '@woocommerce/stores/woocommerce/shopper-lists';
-import '@woocommerce/stores/woocommerce/cart';
+import '@woocommerce/stores/woocommerce';
import type {
RawShopperListItem,
Store as ShopperListsStore,
@@ -17,7 +17,7 @@ import type {
import type {
AddCartItemOutcome,
Store as WooCommerce,
-} from '@woocommerce/stores/woocommerce/cart';
+} from '@woocommerce/stores/woocommerce';
/**
* Internal dependencies
*/
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/test/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/test/frontend.ts
index 81c9ad590fe..939a737f5fb 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/test/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/test/frontend.ts
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
-import type { AddCartItemOutcome } from '@woocommerce/stores/woocommerce/cart';
+import type { AddCartItemOutcome } from '@woocommerce/stores/woocommerce';
import type { RawShopperListItem } from '@woocommerce/stores/woocommerce/shopper-lists';
type BlockActions = {
@@ -57,7 +57,7 @@ jest.mock(
jest.mock( '@woocommerce/stores/woocommerce/shopper-lists', () => ( {} ), {
virtual: true,
} );
-jest.mock( '@woocommerce/stores/woocommerce/cart', () => ( {} ), {
+jest.mock( '@woocommerce/stores/woocommerce', () => ( {} ), {
virtual: true,
} );
jest.mock( '@woocommerce/sanitize', () => ( { sanitizeHTML: jest.fn() } ), {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/frontend.ts
index 9db6a280ec5..d6f003fa77f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/frontend.ts
@@ -9,7 +9,7 @@ import {
type AsyncAction,
} from '@wordpress/interactivity';
import '@woocommerce/stores/woocommerce/shopper-lists';
-import '@woocommerce/stores/woocommerce/cart';
+import '@woocommerce/stores/woocommerce';
import type {
RawShopperListItem,
Store as ShopperListsStore,
@@ -17,7 +17,7 @@ import type {
import type {
AddCartItemOutcome,
Store as WooCommerce,
-} from '@woocommerce/stores/woocommerce/cart';
+} from '@woocommerce/stores/woocommerce';
/**
* Internal dependencies
*/
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/test/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/test/frontend.ts
index 2c6564e33f4..ae440173f3b 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/test/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/test/frontend.ts
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
-import type { AddCartItemOutcome } from '@woocommerce/stores/woocommerce/cart';
+import type { AddCartItemOutcome } from '@woocommerce/stores/woocommerce';
import type { RawShopperListItem } from '@woocommerce/stores/woocommerce/shopper-lists';
type BlockActions = {
@@ -57,7 +57,7 @@ jest.mock(
jest.mock( '@woocommerce/stores/woocommerce/shopper-lists', () => ( {} ), {
virtual: true,
} );
-jest.mock( '@woocommerce/stores/woocommerce/cart', () => ( {} ), {
+jest.mock( '@woocommerce/stores/woocommerce', () => ( {} ), {
virtual: true,
} );
jest.mock( '@woocommerce/sanitize', () => ( { sanitizeHTML: jest.fn() } ), {
diff --git a/plugins/woocommerce/client/blocks/bin/webpack-config-interactive-blocks.js b/plugins/woocommerce/client/blocks/bin/webpack-config-interactive-blocks.js
index 2e5b4ce4bc2..5bdb4189ec1 100644
--- a/plugins/woocommerce/client/blocks/bin/webpack-config-interactive-blocks.js
+++ b/plugins/woocommerce/client/blocks/bin/webpack-config-interactive-blocks.js
@@ -56,7 +56,7 @@ const entries = {
'woocommerce/product-collection-cart-reference':
'./assets/js/blocks/product-collection/cart-reference-frontend.ts',
// Other
- '@woocommerce/stores/woocommerce/cart':
+ '@woocommerce/stores/woocommerce':
'./assets/js/base/stores/woocommerce/cart.ts',
'@woocommerce/stores/store-notices':
'./assets/js/base/stores/store-notices.ts',
diff --git a/plugins/woocommerce/client/blocks/changelog/wooplug-7779-woocommerce-store-module-id b/plugins/woocommerce/client/blocks/changelog/wooplug-7779-woocommerce-store-module-id
new file mode 100644
index 00000000000..dd97f2a14b7
--- /dev/null
+++ b/plugins/woocommerce/client/blocks/changelog/wooplug-7779-woocommerce-store-module-id
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Load the `woocommerce` Interactivity API store from the `@woocommerce/stores/woocommerce` script module, which replaces `@woocommerce/stores/woocommerce/cart`.
diff --git a/plugins/woocommerce/client/blocks/eslint.config.mjs b/plugins/woocommerce/client/blocks/eslint.config.mjs
index 1411820e8b2..0482343d49a 100644
--- a/plugins/woocommerce/client/blocks/eslint.config.mjs
+++ b/plugins/woocommerce/client/blocks/eslint.config.mjs
@@ -145,7 +145,7 @@ const coreModules = [
'@woocommerce/shared-context',
'@woocommerce/shared-hocs',
'@woocommerce/stores/store-notices',
- '@woocommerce/stores/woocommerce/cart',
+ '@woocommerce/stores/woocommerce',
'@woocommerce/stores/woocommerce/products',
'@woocommerce/stores/woocommerce/shopper-lists',
'@woocommerce/tracks',
diff --git a/plugins/woocommerce/client/blocks/tests/js/jest.config.js b/plugins/woocommerce/client/blocks/tests/js/jest.config.js
index a83e40346a0..149ac54f6b1 100644
--- a/plugins/woocommerce/client/blocks/tests/js/jest.config.js
+++ b/plugins/woocommerce/client/blocks/tests/js/jest.config.js
@@ -106,6 +106,8 @@ module.exports = {
'@woocommerce/test-utils/msw': 'tests/js/config/msw-setup.js',
'^@woocommerce/entities/(.*)$': 'packages/internal/entities/$1',
'^@woocommerce/entities$': 'packages/internal/entities',
+ '^@woocommerce/stores/woocommerce$':
+ 'assets/js/base/stores/woocommerce/cart',
'@woocommerce/stores/(.*)$': 'assets/js/base/stores/$1',
'^react$': '<rootDir>/node_modules/react',
'^react-dom$': '<rootDir>/node_modules/react-dom',
diff --git a/plugins/woocommerce/client/blocks/tsconfig.base.json b/plugins/woocommerce/client/blocks/tsconfig.base.json
index dc54b3f16f2..777daf86990 100644
--- a/plugins/woocommerce/client/blocks/tsconfig.base.json
+++ b/plugins/woocommerce/client/blocks/tsconfig.base.json
@@ -148,7 +148,7 @@
"@woocommerce/stores/store-notices": [
"assets/js/base/stores/store-notices"
],
- "@woocommerce/stores/woocommerce/cart": [
+ "@woocommerce/stores/woocommerce": [
"assets/js/base/stores/woocommerce/cart"
],
"@woocommerce/stores/woocommerce/products": [
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 b11e507657a..1171c8975c1 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
@@ -810,7 +810,7 @@ test.describe( 'Add to Cart + Options Block', () => {
const { store } = await import( '@wordpress/interactivity' );
const unlockKey =
'I acknowledge that using a private store means my plugin will inevitably break on the next store release.';
- await import( '@woocommerce/stores/woocommerce/cart' );
+ await import( '@woocommerce/stores/woocommerce' );
const { actions } = store(
'woocommerce',
{},
diff --git a/plugins/woocommerce/tests/e2e/tests/blocks/cart-store/mutation-batcher.block_theme.spec.ts b/plugins/woocommerce/tests/e2e/tests/blocks/cart-store/mutation-batcher.block_theme.spec.ts
index 624f56ddb70..ef523a9905c 100644
--- a/plugins/woocommerce/tests/e2e/tests/blocks/cart-store/mutation-batcher.block_theme.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/blocks/cart-store/mutation-batcher.block_theme.spec.ts
@@ -47,7 +47,7 @@ test.describe( 'Mutation Batcher', () => {
const unlockKey =
'I acknowledge that using a private store means my plugin will inevitably break on the next store release.';
- await import( '@woocommerce/stores/woocommerce/cart' );
+ await import( '@woocommerce/stores/woocommerce' );
const { actions } = store( 'woocommerce', {}, { lock: unlockKey } );
await actions.waitForIdle();
} );
diff --git a/plugins/woocommerce/tests/e2e/tsconfig.json b/plugins/woocommerce/tests/e2e/tsconfig.json
index 44482c84b13..e0f1431cea1 100644
--- a/plugins/woocommerce/tests/e2e/tsconfig.json
+++ b/plugins/woocommerce/tests/e2e/tsconfig.json
@@ -7,7 +7,7 @@
"baseUrl": ".",
"paths": {
"@woocommerce/e2e-utils": [ "./utils/blocks" ],
- "@woocommerce/stores/woocommerce/cart": [
+ "@woocommerce/stores/woocommerce": [
"../../client/blocks/assets/js/base/stores/woocommerce/cart"
]
},