Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
fix(content): say "not in stock" for a shopping product with no variant in stock, not "sold out" (#1662)
Cihane9af9acc24f6
diff --git a/docs/guides/content-editor.mdx b/docs/guides/content-editor.mdxindex c8c5b293d..2908d7c42 100644--- a/docs/guides/content-editor.mdx+++ b/docs/guides/content-editor.mdx@@ -155,7 +155,7 @@ The Content Agent never changes these passages. If you edit one, the editor asks- **Copy HTML** copies the whole page as HTML, HTML blocks and schema included, to paste into your CMS.- **Export** downloads the page as **Word**, **HTML** or **Markdown**. Only the HTML file carries the schema (JSON-LD).- **Add HTML** in the toolbar adds an HTML block: an embed, a widget or a form, kept exactly as written. Ansvisor never runs it. **Edit as HTML** shows the page's source; scripts, iframes and inline styles are removed when you switch back.-- **Products** (the bag in the toolbar, or **Add › Products** on an empty line), on an online shop's draft, adds products from your catalog: search by name, pick 1 to 4 that are in stock, and **Insert**. One shows as a card, more as a grid, each with its picture, name and price (in stock before low stock, then its cheapest variant there; a sale price when it's lower), linked to its page. It goes in as an HTML block; Webflow's rich text has no grid, so there it's a list, a product a line. A product sold out by the time you insert is left out, and the editor says so. When the Content Agent writes a new buying guide, best-of list, comparison or alternatives page with a shopping path, it adds the same grid of the path's products in stock (two or more), at the end of the section that links them most.+- **Products** (the bag in the toolbar, or **Add › Products** on an empty line), on an online shop's draft, adds products from your catalog: search by name, pick 1 to 4 that are in stock, and **Insert**. One shows as a card, more as a grid, each with its picture, name and price (in stock before low stock, then its cheapest variant there; a sale price when it's lower), linked to its page. It goes in as an HTML block; Webflow's rich text has no grid, so there it's a list, a product a line. A product no longer in stock by the time you insert is left out, and the editor says so. When the Content Agent writes a new buying guide, best-of list, comparison or alternatives page with a shopping path, it adds the same grid of the path's products in stock (two or more), at the end of the section that links them most.- **Send to CMS** (admins and managers) sends the page to the brand's Webflow collection as a draft item, or to your workflow tool through the brand's webhook, for it to create the post in your CMS. See [Send to CMS](/guides/send-to-cms).- **Mark ready** saves the page, sets it to **Ready** and keeps a version in History. If the draft was sent to the Action Center, it also completes its task there. Ansvisor doesn't publish the page: copy or export it to your site, or send it to your CMS. On a page with a shopping path, **Before you publish** also names the product cards whose price has changed in your catalog since they went in. A card keeps its price: to show today's, replace the card by deleting it and adding the product again (**Add › Products**).- **Mark published** (the Library's **Status** menu, or the header's **Next step** once the page is ready, when Quality is on): once the page is live, tell Ansvisor where. It asks for the live address, starting from the page it optimizes or your site with the page's slug, and the **Live page** tab measures that address from then. If the draft came from the Action Center, its Publish task is completed once all the action's work is live. On a published page, the header's **Published** button changes the address. A page your CMS reports live, or one published in Webflow, gets its address on its own. An archived page is restored first.diff --git a/web/messages/en.json b/web/messages/en.jsonindex 958dceb97..c2a6bf576 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -4081,7 +4081,7 @@"notForAgentFeedShopping": "Content Agent doesn't change a price, GTIN or stock, or which products the page links: check which is right, the page or your product feed, and fix that one; then remove or replace the links to products that are out of stock, refused or gone.","notForAgent": "Content Agent doesn't change heading levels: make the extra H1s H2s in the toolbar.","notForAgentFeed": "Content Agent doesn't change a price, GTIN or stock: check which is right, the page or your product feed, and fix that one.",- "notForAgentShopping": "Content Agent doesn't change which products the page links: remove or replace the links to sold-out, refused or gone products yourself.",+ "notForAgentShopping": "Content Agent doesn't change which products the page links: remove or replace the links to products that are out of stock, refused or gone yourself.","decideFirst": "{count, plural, one {Review the open suggestion first, then run the agent.} other {Review the open suggestions first, then run the agent.}}","citedLoading": "Reading which passages AI quotes, so the agent leaves them as they are…","agentBusy": "Content Agent is already working on this page. Wait for it to finish.",@@ -4509,7 +4509,7 @@"addThis": "Add {title}","leftOut": "Left out","reason": {- "sold_out": "sold out",+ "sold_out": "not in stock","refused": "Merchant Center refuses it","no_link": "no page to link","gone": "no longer in the catalog",@@ -4524,7 +4524,7 @@"placeholder": "Product name…","empty": "No product with that name.","searchFailed": "Couldn't search the catalog. Try again.",- "soldOut": "Sold out",+ "notInStock": "Not in stock","noPage": "No page to link","picked": "{count} of {max} picked","unpick": "Remove {title}",@@ -5077,7 +5077,7 @@"okDetail": "{count, plural, =0 {{category, select, yes {No product linked yet; the category page is.} other {No product linked yet.}}} one {# product linked, in stock and accepted by Merchant Center.} other {# products linked, in stock and accepted by Merchant Center.}}","bad": "{count, plural, one {# product link to remove or replace} other {# product links to remove or replace}}","badDetail": "{list}{more, plural, =0 {} other { +# more}}. Remove or replace these links on the page: Brief › Shopping path lists products that sell.",- "item": "{title} ({state, select, sold_out {sold out} refused {Merchant Center refuses it} gone {no longer in the catalog} other {check it}})",+ "item": "{title} ({state, select, sold_out {not in stock} refused {Merchant Center refuses it} gone {no longer in the catalog} other {check it}})","noCategory": "No link to the category page","noCategoryDetail": "Link the category page in Brief › Shopping path, so readers reach the products.","few": "{count} of {want} products linked",@@ -5556,7 +5556,7 @@"feedMatch": "Price, GTIN and stock match the feed","shopCategoryLink": "Links its category page","shopProductLinks": "Links the shopping path's products",- "shopLinksLive": "No sold-out or refused product linked",+ "shopLinksLive": "No out-of-stock or refused product linked","fitQuestions": "Answer fit and sizing questions","first40Words": "Type + key attributes in the first 40 words","introText": "Intro text above products",@@ -5675,7 +5675,7 @@"heldLength": "Only the Length is left open, and a rewrite can't reach it. Raise the Length, or leave it.","heldSentence": "Kept by AI citations · yours to decide: the long sentences are in passages AI answers quote, which the agent keeps. Shorten them yourself (Edit anyway), or leave them quoted.","shopLinksLiveNote": "{list}{more, plural, =0 {} other { +# more}}: remove or replace these links on the page.",- "shopItem": "{title} ({state, select, sold_out {sold out} refused {Merchant Center refuses it} gone {no longer in the catalog} other {check it}})",+ "shopItem": "{title} ({state, select, sold_out {not in stock} refused {Merchant Center refuses it} gone {no longer in the catalog} other {check it}})","fixTrace": "Fix","fixTraceHint": "Content Agent rewrites only these phrases, for you to review","agent": {diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsxindex c1854447c..c7a50e51b 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx@@ -213,7 +213,7 @@ describe('BeforePublish', () => {});const bad = rows().find((r) => r?.startsWith('2 product links to remove or replace'));expect(bad).toContain(- 'Canyon (sold out), Ridge (Merchant Center refuses it). Remove or replace these links on the page',+ 'Canyon (not in stock), Ridge (Merchant Center refuses it). Remove or replace these links on the page',);const five = ['A', 'B', 'C', 'D', 'E'].map((t) => product(t, 'gone'));diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_product-block-dialog.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_product-block-dialog.test.tsxindex b77b7f417..03f1c0029 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_product-block-dialog.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_product-block-dialog.test.tsx@@ -127,7 +127,7 @@ describe('ProductBlockDialog', () => {]);await render();await search('boot');- expect(hit('Boot 1')!.textContent).toBe('Boot 1Sold out');+ expect(hit('Boot 1')!.textContent).toBe('Boot 1Not in stock');expect(hit('Boot 1')!.disabled).toBe(true);expect(hit('Boot 2')!.textContent).toBe('Boot 2No page to link');expect(hit('Boot 2')!.disabled).toBe(true);diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_product-block-dialog.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_product-block-dialog.tsxindex 65c61fb2e..663e6939b 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_product-block-dialog.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_product-block-dialog.tsx@@ -83,9 +83,9 @@ export function ProductBlockDialog({}, [query, brandId]);const isPicked = (id: string) => picked.some((p) => p.id === id);- /** Why a product can't go in a block, or null: sold out, or no page to link. */+ /** Why a product can't go in a block, or null: not in stock, or no page to link. */const blocked = (p: BlockProductRead) =>- !p.inStock ? t('soldOut') : !productHref(p.url) ? t('noPage') : null;+ !p.inStock ? t('notInStock') : !productHref(p.url) ? t('noPage') : null;const toggle = (hit: BlockProductRead) =>setPicked((now) =>now.some((p) => p.id === hit.id)diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_rules-tab.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_rules-tab.test.tsxindex 2d89b21ab..9ff09bc0f 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_rules-tab.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_rules-tab.test.tsx@@ -532,11 +532,11 @@ describe('the Rules tab', () => {}));await render(state(undefined, { rules: checked, ...rulesMet(checked) }));const live = [...container.querySelectorAll('li')].find((li) =>- li.textContent?.startsWith('No sold-out or refused product linked'),+ li.textContent?.startsWith('No out-of-stock or refused product linked'),)!;expect(live.textContent).toContain('4 found');expect(live.textContent).toContain(- 'A (sold out), B (Merchant Center refuses it), C (sold out) +1 more: remove or replace these links on the page.',+ 'A (not in stock), B (Merchant Center refuses it), C (not in stock) +1 more: remove or replace these links on the page.',);});diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_shopping-path.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_shopping-path.test.tsxindex e15c2a607..67299c617 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_shopping-path.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_shopping-path.test.tsx@@ -153,7 +153,7 @@ describe('ShoppingPathSection', () => {expect(text).toContain('1 Merchant Center issue: gtin');expect(text).toContain('Top picks #1');expect(text).toContain('Top picks #2');- expect(text).toContain('Canyon Low WP · sold out');+ expect(text).toContain('Canyon Low WP · not in stock');});it('picks from the catalog the first time, and says when a draft takes none', async () => {diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsxindex 7cb0eee22..3c98d74f4 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx@@ -5829,7 +5829,7 @@ describe('the side panel', () => {expect(dialogText()).not.toContain('Reading your catalog');expect(dialogText()).toContain('1 product link to remove or replace');expect(dialogText()).toContain(- 'Trail (sold out). Remove or replace these links on the page',+ 'Trail (not in stock). Remove or replace these links on the page',);expect(dialogText()).not.toContain('No link to the category page');} finally {diff --git a/web/src/lib/content/shopping-check.ts b/web/src/lib/content/shopping-check.tsindex 0faa98484..09c913183 100644--- a/web/src/lib/content/shopping-check.ts+++ b/web/src/lib/content/shopping-check.ts@@ -9,7 +9,11 @@ import { linkKey } from '@/lib/content/link-targets';* it or the path left out: the page may still link it.*/-/** A product's state now: sold out, refused by Merchant Center, gone from the catalog, or fine. */+/**+ * A product's state now: not in stock (`sold_out`: no variant in stock, so+ * pre-order, back-order and no stock given too), refused by Merchant+ * Center, gone from the catalog, or fine.+ */export type ShoppingLinkState = 'ok' | 'sold_out' | 'refused' | 'gone';export interface ShoppingProductCheck {