Skip to content

docs: refresh discounts and coupons pages for v1.9.0#188

Merged
kilbot merged 4 commits into
mainfrom
docs/coupons-v1.9
May 18, 2026
Merged

docs: refresh discounts and coupons pages for v1.9.0#188
kilbot merged 4 commits into
mainfrom
docs/coupons-v1.9

Conversation

@kilbot
Copy link
Copy Markdown
Contributor

@kilbot kilbot commented May 18, 2026

Summary

  • Update pos/cart/discounts.mdx and reference/pos-discounts.mdx to reflect the v1.9.0 subtotal-parity refactor.
  • Mark the Coupon Codes section clearly as Pro, fix the UI flow (Add Coupon button in the cart, not at checkout), and correct validation details (client-side from synced data).
  • Add a new "What changed in v1.9.0" section explaining why POS line-item price changes no longer appear as a "Discount" total on receipts and reports — the question support has been getting since the upgrade.
  • Strip the obsolete woocommerce_order_item_get_subtotal filter mechanism from the developer reference (removed in free plugin PR #686) and document the new subtotal model with a link to the ADR.
  • Clarify that the coupons REST endpoint lives in the free plugin purely for 404-avoidance on the blurred-out Pro coupons page, while the feature itself remains Pro.

Test plan

  • pnpm start (or npm run start) and open /pos/cart/discounts — verify the page renders, the new "What changed in v1.9.0" section is present, the Pro badge appears on Coupon Codes, and internal links to /reference/pos-discounts, /pos/cart/line-items, and /pos/cart#display-settings resolve.
  • Open /reference/pos-discounts — verify the obsolete "Technical Details" / woocommerce_order_item_get_subtotal content is gone, the new "Subtotal Model (v1.9.0+)" section is present, the ADR link resolves on the wiki repo, and the woocommerce_pos_item_is_on_sale filter table renders.
  • Skim both pages for Docusaurus admonition rendering (:::info, :::tip, :::note) — confirm they render correctly.
  • Check the sidebar still shows "Discounts" under POS > Cart and "POS Discounts" under Reference.

Known blockers

None — docs-only change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated Discounts and Coupons guides with new wording, reorganized coupon workflow, and refreshed POS vs WooCommerce comparison
    • Clarified how coupons interact with POS price edits, subtotal/total behavior, and “exclude sale items” rules
    • Expanded v1.9.0 notes covering receipt/report effects, stored metadata, and offline coupon application caveats
    • Added developer reference details, a coupon REST endpoint overview, and a new Coupons doc in the sidebar

Review Change Stack

Update both the user-facing discounts page and the developer reference
to reflect the v1.9.0 subtotal-parity refactor and current coupons UX:

- Mark coupons clearly as a Pro feature with the upgrade note
- Fix UI flow (Add Coupon button in cart, not at checkout) and
  validation details (client-side from synced data)
- Add 'What changed in v1.9.0' section explaining why POS line-item
  price overrides no longer appear as discounts on receipts/reports
- Remove obsolete subtotal-filter mechanism from the developer
  reference (removed in free plugin #686) and document the new model
- Clarify why the coupons REST endpoint lives in the free plugin
  (404 avoidance) even though the feature itself requires Pro
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 18, 2026 4:23pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: wcpos/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4dd34cf5-bdba-4f85-bccd-9e5743e100c7

📥 Commits

Reviewing files that changed from the base of the PR and between 3b64a82 and 84692fb.

📒 Files selected for processing (4)
  • versioned_docs/version-1.x/coupons/index.mdx
  • versioned_docs/version-1.x/pos/cart/discounts.mdx
  • versioned_docs/version-1.x/reference/pos-discounts.mdx
  • versioned_sidebars/version-1.x-sidebars.json
✅ Files skipped from review due to trivial changes (2)
  • versioned_sidebars/version-1.x-sidebars.json
  • versioned_docs/version-1.x/reference/pos-discounts.mdx

📝 Walkthrough

Walkthrough

Updates v1.9.0 documentation: adds a new Coupons doc, revises Cart Discounts to explain POS discounts vs WooCommerce coupons and how coupons apply to POS-edited prices, expands developer reference with _woocommerce_pos_data semantics, subtotal/total model, REST coupons endpoint, receipt exposure rules, and adds a sidebar entry.

Changes

Discounts & Coupons v1.9.0 Documentation

Layer / File(s) Summary
User docs: Coupons & Cart Discounts
versioned_docs/version-1.x/coupons/index.mdx, versioned_docs/version-1.x/pos/cart/discounts.mdx
Adds a full Coupons page; revises Cart Discounts title/intro and replaces prior coupon section with "POS Discounts vs WooCommerce Coupons", explains coupon calculation against POS-edited prices, marks POS-discounted items as "on sale" for exclude-sale behavior, expands v1.9.0 changelog and trims connectivity limitation bullet.
Developer reference: POS price overrides & subtotal model
versioned_docs/version-1.x/reference/pos-discounts.mdx
Reframes doc as developer reference, defines _woocommerce_pos_data as per-unit POS storage, introduces "Subtotal Model (v1.9.0+)" describing subtotal/total/discount_total semantics and migration note, documents coupon interaction rules and woocommerce_pos_item_is_on_sale filter, documents /wp-json/wcpos/v1/coupons endpoint and receipt data exposure rules.
Sidebar wiring: add Coupons category
versioned_sidebars/version-1.x-sidebars.json
Inserts a new top-level "Coupons" sidebar category linking to coupons/index between "Customers" and "Reports".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • Coupon support roadmap#2: Docs now document coupon support and the /wp-json/wcpos/v1/coupons endpoint, aligning with the roadmap item to expose and document coupon support for POS.

Possibly related PRs

  • wcpos/docs#182: Related docs updates aligning POS discount ↔ receipt/report semantics.
  • wcpos/docs#102: Earlier expansion of POS discounts and coupon interaction content in the same files.

Poem

📚 Coupons and discounts in tidy rows,
docs whisper how the subtotal flows.
POS edits meet coupons fair,
receipts now show truth laid bare.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: refreshing documentation for discounts and coupons to reflect v1.9.0 behavior, which aligns with all file changes in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/coupons-v1.9

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@versioned_docs/version-1.x/reference/pos-discounts.mdx`:
- Line 25: The sentence incorrectly states both subtotal and total are derived
from price * qty; update the copy so it only scopes "price * qty" to subtotal
(e.g., say WooCommerce's stored subtotal on the line item is derived from price
* qty with tax/rounding applied) and then clarify that line_item.total is
computed as subtotal minus coupon_discount_for_line (so integrators should read
_woocommerce_pos_data.price and regular_price for per‑unit precision and not
rely on total when coupons apply).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: wcpos/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ab141157-dd67-455f-972f-c0d65e4335bd

📥 Commits

Reviewing files that changed from the base of the PR and between 423db90 and 52dc11c.

📒 Files selected for processing (2)
  • versioned_docs/version-1.x/pos/cart/discounts.mdx
  • versioned_docs/version-1.x/reference/pos-discounts.mdx

Comment thread versioned_docs/version-1.x/reference/pos-discounts.mdx Outdated
Copy link
Copy Markdown
Contributor Author

kilbot commented May 18, 2026

# Source File Class Category Decision Outcome
1 CodeRabbit pos-discounts.mdx Logic Correctness Fix Scope price * qty to subtotal and clarify total can be lower when coupons apply.

Copy link
Copy Markdown
Contributor Author

kilbot commented May 18, 2026

Thread File Issue Decision Commit
3259515616 pos-discounts.mdx price * qty was described as deriving both subtotal and total, but coupon discounts can lower total. Fixed 3b64a82

Excluded threads:

Thread Reason for skipping
None No excluded actionable threads.

kilbot added 2 commits May 18, 2026 18:19
Coupons is a top-level Pro screen alongside Products, Orders, and
Customers, so it gets its own page rather than being buried under
POS > Cart > Discounts.

- Add coupons/index.mdx covering the Coupons screen, coupon types,
  creating coupons in WP Admin (with POS-oriented tips for manager
  and loyalty discounts), applying at the register, validation
  rules, and sync behaviour
- Slim pos/cart/discounts.mdx to focus on cashier-applied discounts
  (quick percentages, line-item price edits, order-level fees);
  link to the new Coupons page for everything coupon-related
- Wire Coupons into the version-1.x sidebar between Customers and
  Reports, matching its position in the app menu
@kilbot kilbot merged commit 380532d into main May 18, 2026
9 checks passed
@kilbot kilbot deleted the docs/coupons-v1.9 branch May 18, 2026 16:34
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.

1 participant