Skip to content

fix(content): say "not in stock" for a shopping product with no variant in stock, not "sold out" - #1662

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/shopping-not-in-stock
Oct 28, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/shopping-not-in-stock

Conversation

@cihan-gyk

@cihan-gyk cihan-gyk commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-ups from #1610 (item 2) and #1607 (item 3). The editor says "not in stock" instead of "sold out" for a catalog product with no variant in stock. That covers sold out, but also pre-order, back-order and no stock given, so "sold out" was wrong for most of them.

Changed wording:

  • the Add › Products dialog;
  • the shopping path's Left out list;
  • the Rules tab's and Before you publish's Shopping rule, and its items. The rule is now named "No out-of-stock or refused product linked";
  • the note that Content Agent doesn't change product links.

The API's sold_out reason and state are unchanged. The product dialog's message key is renamed soldOut → notInStock.

Merge note: this PR and #1663 (one price rule) change the same sentence in docs/guides/content-editor.mdx (line 158). Whichever merges second needs a one-line merge. The combined sentence reads: "…price (in stock before low stock, then its cheapest variant there; a sale price when it's lower)… A product no longer in stock by the time you insert is left out…". I'll merge main forward after the first one merges.

Where people see it: a shop draft's Add › Products. Checked in the browser (local, 1024 px) with a temporary catalog on the demo brand: an out-of-stock product reads "Not in stock" and can't be picked. The temporary rows were deleted afterwards.

Related issue

Follow-ups from #1607's and #1610's reviews.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. On a shop draft (brand site type ecommerce) with an out-of-stock product in the catalog, open Add › Products and search for it: "Not in stock", disabled.
  2. grep -rni "sold out" web/src web/messages docs: only the API's sold_out key is left.

Follow-ups: two code comments still name the old rule (_rules-tab.tsx, shopping-check.ts). notForAgentShopping says "out of stock", which could become "not in stock".

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Full checks were run once, in one tree with this batch's six follow-up branches merged (#1653, #1654 and the four PRs of this batch):

  • server format, lint and npm test: 249 files, 3,356 tests passed;
  • web format, lint (0 errors), typecheck, vitest (445 files, 4,350 tests) and build: all pass.

A pre-push review was done, and its findings for this branch are fixed.

🤖 Generated with Claude Code

…nt in stock, not "sold out"

Follow-ups from ansvisor#1610 (item 2) and ansvisor#1607 (item 3). A product is taken as
not selling when none of its variants is in stock: sold out, but also
pre-order, back-order and no stock given. The editor called all of them
"sold out": the Insert › Products dialog, the shopping path's Left out
list, the Rules tab's and Before you publish's Shopping rule and its
items, and the note that Content Agent doesn't change product links.
They now say "not in stock" ("No out-of-stock or refused product linked"
for the rule). The API's `sold_out` reason and state stay as they are;
the product dialog's message key is renamed to notInStock to match.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mintlify

mintlify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit b632ac2.

Approve preview

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, with follow-ups.

What I checked:

  • Own change. 0443305 on main (3f6a4d4). It merges cleanly on main, #1653 and #1654. With #1663 or #1664 there's one conflict, the one the description names: the Products sentence in docs/guides/content-editor.mdx. The combined sentence proposed in the description is right.
  • Every place a user saw "sold out" now says "not in stock": the Add › Products dialog (soldOut → notInStock; nothing else used the old key), the Brief's Left out reason, and the Rules tab and Before you publish items. On this head, sold out appears in web/src only in comments and test names, and the API's sold_out state is unchanged.
  • Tests. The five touched test files pass. With main's en.json and dialog put back, four of them fail, one per place.

Follow-ups (low):

  1. The rule's new name, "No out-of-stock or refused product linked", and the agent's notForAgentShopping and #1654's notForAgentFeedShopping say "out of stock". That's the same mismatch as "sold out" for a pre-order or back-order product. "not in stock" there too would match the items under the rule.
  2. The two stale comments the description lists (_rules-tab.tsx:567, shopping-check.ts:26).

Before the API deploy: web and docs only. Nothing depends on the API.

@gkhngyk
gkhngyk merged commit e9af9ac into ansvisor:main Oct 28, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants