Commit 9d36fad4a78 for woocommerce

commit 9d36fad4a78ceed5ecd9eb7d6f3c415fee8febc5
Author: AnnaMag <AnnaMag@users.noreply.github.com>
Date:   Fri Dec 4 13:27:38 2026 +0100

    Use the ai-tools slug for the AI tools settings tab (#71846)

    The tab was renamed to AI tools, but its URL still said tab=agentic-commerce.
    The slug only shipped in 11.4.0-beta.1, so it changes without a redirect.

diff --git a/plugins/woocommerce/changelog/wooai-1936-ai-tools-tab-slug b/plugins/woocommerce/changelog/wooai-1936-ai-tools-tab-slug
new file mode 100644
index 00000000000..d35a31657a9
--- /dev/null
+++ b/plugins/woocommerce/changelog/wooai-1936-ai-tools-tab-slug
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+Comment: Rename the unreleased AI tools settings tab slug to ai-tools; no stable release used the old one.
+
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/components/product-visibility.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/components/product-visibility.tsx
index 288c274e84b..afdd30b7a02 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/components/product-visibility.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/components/product-visibility.tsx
@@ -24,7 +24,7 @@ export const ProductVisibility = ( {
 	visibility: ShoppingView[ 'visibility' ];
 } ) => (
 	// Sales readiness links here when no product can be listed.
-	<div id="wc-agentic-commerce-visibility">
+	<div id="wc-ai-tools-visibility">
 		{ visibility.empty ? (
 			<Text variant="body-md" className="wc-sales-readiness__muted">
 				{ visibility.empty }
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/test/ai-shopping.test.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/test/ai-shopping.test.tsx
index f3d981f79a8..9bea2ca4f99 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/test/ai-shopping.test.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/test/ai-shopping.test.tsx
@@ -55,7 +55,7 @@ const pages = [

 const view = ( fields: Partial< ShoppingView > = {} ): ShoppingView => ( {
 	parent: {
-		href: '/wp-admin/admin.php?page=wc-settings&tab=agentic-commerce',
+		href: '/wp-admin/admin.php?page=wc-settings&tab=ai-tools',
 		text: 'AI tools',
 	},
 	title: 'AI shopping',
diff --git a/plugins/woocommerce/client/legacy/css/admin.scss b/plugins/woocommerce/client/legacy/css/admin.scss
index 2038302333e..d0f61deb966 100644
--- a/plugins/woocommerce/client/legacy/css/admin.scss
+++ b/plugins/woocommerce/client/legacy/css/admin.scss
@@ -9747,7 +9747,7 @@ body.woocommerce-settings-payments-section_legacy {

 // Settings > AI tools.
 // A light grey panel under a grey tab strip.
-body.woocommerce_page_wc-settings.woocommerce-settings-agentic-commerce-tab {
+body.woocommerce_page_wc-settings.woocommerce-settings-ai-tools-tab {

 	.nav-tab-wrapper {
 		background-color: #f0f0f1;
diff --git a/plugins/woocommerce/includes/admin/views/html-admin-settings.php b/plugins/woocommerce/includes/admin/views/html-admin-settings.php
index c05d0c750fb..897303f9827 100644
--- a/plugins/woocommerce/includes/admin/views/html-admin-settings.php
+++ b/plugins/woocommerce/includes/admin/views/html-admin-settings.php
@@ -64,7 +64,7 @@ try {
 // Drill-down pages replace the top-level settings tabs with their own header when the shell can render.
 // AI tools > AI shopping renders its header, with the breadcrumb back to AI tools, from settings-embed.
 $hide_nav = ( 'checkout' === $current_tab && in_array( $current_section, array( 'offline', 'bacs', 'cheque', 'cod' ), true ) )
-	|| ( 'agentic-commerce' === $current_tab && 'shopping' === $current_section )
+	|| ( 'ai-tools' === $current_tab && 'shopping' === $current_section )
 	|| $is_rendering_settings_ui_drill_down;

 $is_settings_ui_page = null !== $settings_ui_settings_page;
diff --git a/plugins/woocommerce/src/Internal/AgentReadiness/AgenticCommerceSettings.php b/plugins/woocommerce/src/Internal/AgentReadiness/AgenticCommerceSettings.php
index 6f9797471de..0bcabf8568e 100644
--- a/plugins/woocommerce/src/Internal/AgentReadiness/AgenticCommerceSettings.php
+++ b/plugins/woocommerce/src/Internal/AgentReadiness/AgenticCommerceSettings.php
@@ -15,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
  */
 class AgenticCommerceSettings implements RegisterHooksInterface {

-	public const TAB = 'agentic-commerce';
+	public const TAB = 'ai-tools';

 	/**
 	 * The AI shopping section of the tab, which the landing page's Manage button opens.
@@ -259,7 +259,7 @@ class AgenticCommerceSettings implements RegisterHooksInterface {
 		if ( ! is_string( $classes ) || self::TAB !== $current_tab ) {
 			return $classes;
 		}
-		return "$classes woocommerce-settings-agentic-commerce-tab";
+		return "$classes woocommerce-settings-ai-tools-tab";
 	}

 	/**
diff --git a/plugins/woocommerce/src/Internal/AgentReadiness/README.md b/plugins/woocommerce/src/Internal/AgentReadiness/README.md
index 180eddbf600..a33fb6b7434 100644
--- a/plugins/woocommerce/src/Internal/AgentReadiness/README.md
+++ b/plugins/woocommerce/src/Internal/AgentReadiness/README.md
@@ -207,7 +207,7 @@ The scan walks published simple and variable products not set to Hidden in batch

 ## AI tools and Sales readiness

-WooCommerce > Settings > AI tools (`AgenticCommerceSettings`, `AgenticCommerceSettingsPage`; the tab id stays `agentic-commerce`) and WooCommerce > Sales readiness (`ReadinessCheckPage`, a WooCommerce Admin page at `admin.php?page=wc-admin&path=/sales-readiness`, between Reports and Settings in the menu) show in the admin. They follow the WOOPRD-3796 and WOOPRD-3947 designs. Both are React views on `@wordpress/ui` in `client/admin/client/sales-readiness/`, fed by `GET wc/v3/agent-readiness/view`; every string, badge and ranking is built in `ReadinessCheckPage::view()`, where the tests are. AI tools opens on the Overview, a React root mounted by the `settings-embed` script, with two cards. The AI shopping card has the Status badge, whether AI assistants can shop the store and how many setup steps are left, and a button that opens AI shopping (`&section=shopping`): Continue setup while a required step is left, otherwise View settings. Before the UCP setting is first saved, the card says what AI shopping does and offers Set up AI shopping instead; once UCP is turned off, it says AI shopping is off. The Sales readiness card has Fix first (no card when nothing fails; Check your store before the first scan) and View all checks, which opens the page. AI shopping (`&section=shopping`) is a React view too (`client/admin/client/sales-readiness/ai-shopping.tsx`, mounted by `settings-embed`): an `@wordpress/admin-ui` Page with a breadcrumb back to AI tools and Save in its header, then `@wordpress/dataviews` DataForm cards. `AgenticCommerceSettingsPage` builds everything it shows (steps with their button labels and links, counts, the policy pages, the connection URL, coming soon) and prints it as JSON on the root, so the page draws without a request. Save posts the WooCommerce settings form around the page: the policy fields are hidden inputs named after their options, so they save and validate through the settings fields as before. The page warns before leaving with unsaved fields. The AI tools tab and Sales readiness have no admin footer (`AgenticCommerceSettings::handle_admin_footer()`). The wording of setup steps that AI shopping and Sales readiness share is in the `ReadinessMarkup` trait.
+WooCommerce > Settings > AI tools (`AgenticCommerceSettings`, `AgenticCommerceSettingsPage`) and WooCommerce > Sales readiness (`ReadinessCheckPage`, a WooCommerce Admin page at `admin.php?page=wc-admin&path=/sales-readiness`, between Reports and Settings in the menu) show in the admin. They follow the WOOPRD-3796 and WOOPRD-3947 designs. Both are React views on `@wordpress/ui` in `client/admin/client/sales-readiness/`, fed by `GET wc/v3/agent-readiness/view`; every string, badge and ranking is built in `ReadinessCheckPage::view()`, where the tests are. AI tools opens on the Overview, a React root mounted by the `settings-embed` script, with two cards. The AI shopping card has the Status badge, whether AI assistants can shop the store and how many setup steps are left, and a button that opens AI shopping (`&section=shopping`): Continue setup while a required step is left, otherwise View settings. Before the UCP setting is first saved, the card says what AI shopping does and offers Set up AI shopping instead; once UCP is turned off, it says AI shopping is off. The Sales readiness card has Fix first (no card when nothing fails; Check your store before the first scan) and View all checks, which opens the page. AI shopping (`&section=shopping`) is a React view too (`client/admin/client/sales-readiness/ai-shopping.tsx`, mounted by `settings-embed`): an `@wordpress/admin-ui` Page with a breadcrumb back to AI tools and Save in its header, then `@wordpress/dataviews` DataForm cards. `AgenticCommerceSettingsPage` builds everything it shows (steps with their button labels and links, counts, the policy pages, the connection URL, coming soon) and prints it as JSON on the root, so the page draws without a request. Save posts the WooCommerce settings form around the page: the policy fields are hidden inputs named after their options, so they save and validate through the settings fields as before. The page warns before leaving with unsaved fields. The AI tools tab and Sales readiness have no admin footer (`AgenticCommerceSettings::handle_admin_footer()`). The wording of setup steps that AI shopping and Sales readiness share is in the `ReadinessMarkup` trait.

 AI shopping has one card per part:

diff --git a/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessCheckPage.php b/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessCheckPage.php
index 3fb451be562..9b330108ca5 100644
--- a/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessCheckPage.php
+++ b/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessCheckPage.php
@@ -751,7 +751,7 @@ class ReadinessCheckPage implements RegisterHooksInterface {
 				'title' => __( 'None of your products can be checked yet', 'woocommerce' ),
 				'text'  => __( 'They are hidden from the catalog, or a type AI assistants can’t list yet.', 'woocommerce' ),
 				'link'  => array(
-					'href' => AgenticCommerceSettings::url( AgenticCommerceSettings::SHOPPING_SECTION ) . '#wc-agentic-commerce-visibility',
+					'href' => AgenticCommerceSettings::url( AgenticCommerceSettings::SHOPPING_SECTION ) . '#wc-ai-tools-visibility',
 					'text' => __( 'View product visibility', 'woocommerce' ),
 				),
 			) : array(
diff --git a/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/AgenticCommerceSettingsTest.php b/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/AgenticCommerceSettingsTest.php
index 77f8beb765c..a7861bc3791 100644
--- a/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/AgenticCommerceSettingsTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/AgenticCommerceSettingsTest.php
@@ -86,7 +86,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {

 		$this->assertCount( 1, $pages );
 		$this->assertInstanceOf( AgenticCommerceSettingsPage::class, $pages[0] );
-		$this->assertSame( 'agentic-commerce', $pages[0]->get_id() );
+		$this->assertSame( 'ai-tools', $pages[0]->get_id() );
 	}

 	/**
@@ -97,7 +97,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
 		$previous = $current_tab;
 		try {
 			$current_tab = AgenticCommerceSettings::TAB; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
-			$this->assertStringContainsString( 'woocommerce-settings-agentic-commerce-tab', $this->sut->handle_admin_body_class( 'wp-admin' ) );
+			$this->assertStringContainsString( 'woocommerce-settings-ai-tools-tab', $this->sut->handle_admin_body_class( 'wp-admin' ) );

 			$current_tab = 'checkout'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
 			$this->assertSame( 'wp-admin', $this->sut->handle_admin_body_class( 'wp-admin' ) );
@@ -1485,7 +1485,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
 			$this->assertSame( 'None of your products can be checked yet', $sections[ $id ]['empty']['title'] );
 			$this->assertSame( 'View product visibility', $sections[ $id ]['empty']['link']['text'] );
 			$this->assertStringContainsString( 'section=' . AgenticCommerceSettings::SHOPPING_SECTION, $sections[ $id ]['empty']['link']['href'] );
-			$this->assertStringContainsString( '#wc-agentic-commerce-visibility', $sections[ $id ]['empty']['link']['href'] );
+			$this->assertStringContainsString( '#wc-ai-tools-visibility', $sections[ $id ]['empty']['link']['href'] );
 			$this->assertStringNotContainsString( 'post-new.php', $sections[ $id ]['empty']['link']['href'] );
 		}
 	}
@@ -2832,12 +2832,12 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
 			);
 			return $settings;
 		};
-		add_filter( 'woocommerce_get_settings_agentic-commerce', $add );
+		add_filter( 'woocommerce_get_settings_ai-tools', $add );

 		try {
 			$shopping = $this->shopping();
 		} finally {
-			remove_filter( 'woocommerce_get_settings_agentic-commerce', $add );
+			remove_filter( 'woocommerce_get_settings_ai-tools', $add );
 		}

 		$this->assertSame( 'example_policy[page]', $this->policy( $shopping, 'example_policy_page_id' )['name'] );
@@ -2867,7 +2867,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
 			);
 			return $settings;
 		};
-		add_filter( 'woocommerce_get_settings_agentic-commerce', $add );
+		add_filter( 'woocommerce_get_settings_ai-tools', $add );
 		$_POST['example_policy']                             = array( 'page' => (string) $page );
 		$_POST[ AgenticCommerceSettings::TERMS_PAGE_OPTION ] = (string) $page;

@@ -2879,7 +2879,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
 		} finally {
 			$current_section = ''; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Reset after the save.
 			unset( $_POST['example_policy'], $_POST[ AgenticCommerceSettings::TERMS_PAGE_OPTION ] );
-			remove_filter( 'woocommerce_get_settings_agentic-commerce', $add );
+			remove_filter( 'woocommerce_get_settings_ai-tools', $add );
 		}

 		$this->assertSame( array( 'page' => (string) $page ), get_option( 'example_policy' ), 'save_fields writes the nested option' );
@@ -2898,7 +2898,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
 			);
 			return $settings;
 		};
-		add_filter( 'woocommerce_get_settings_agentic-commerce', $add );
+		add_filter( 'woocommerce_get_settings_ai-tools', $add );
 		update_option( 'example_agentic_checkbox', 'yes' );
 		$page = self::factory()->post->create(
 			array(
@@ -2914,7 +2914,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
 		} finally {
 			$current_section = ''; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Reset after the save.
 			unset( $_POST[ AgenticCommerceSettings::TERMS_PAGE_OPTION ] );
-			remove_filter( 'woocommerce_get_settings_agentic-commerce', $add );
+			remove_filter( 'woocommerce_get_settings_ai-tools', $add );
 		}

 		$this->assertSame( (string) $page, (string) get_option( AgenticCommerceSettings::TERMS_PAGE_OPTION ), 'The posted policy field is saved' );
diff --git a/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/StoreConditionsTest.php b/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/StoreConditionsTest.php
index def70254c9e..82680e22e68 100644
--- a/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/StoreConditionsTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/StoreConditionsTest.php
@@ -146,7 +146,7 @@ class StoreConditionsTest extends WC_Unit_Test_Case {
 	 */
 	public function test_fix_links_open_ai_shopping(): void {
 		$checks   = array_column( $this->sut->all(), 'fix_url', 'id' );
-		$shopping = admin_url( 'admin.php?page=wc-settings&tab=agentic-commerce&section=shopping' );
+		$shopping = admin_url( 'admin.php?page=wc-settings&tab=ai-tools&section=shopping' );

 		$this->assertSame( $shopping, $checks['ucp_on'] );
 		$this->assertSame( $shopping . '#' . AgenticCommerceSettings::TERMS_PAGE_OPTION, $checks['terms_page'] );