docs: refresh discounts and coupons pages for v1.9.0#188
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: wcpos/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughUpdates 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 ChangesDiscounts & Coupons v1.9.0 Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
versioned_docs/version-1.x/pos/cart/discounts.mdxversioned_docs/version-1.x/reference/pos-discounts.mdx
|
Excluded threads:
|
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
Summary
pos/cart/discounts.mdxandreference/pos-discounts.mdxto reflect the v1.9.0 subtotal-parity refactor.woocommerce_order_item_get_subtotalfilter mechanism from the developer reference (removed in free plugin PR #686) and document the new subtotal model with a link to the ADR.Test plan
pnpm start(ornpm 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-settingsresolve./reference/pos-discounts— verify the obsolete "Technical Details" /woocommerce_order_item_get_subtotalcontent is gone, the new "Subtotal Model (v1.9.0+)" section is present, the ADR link resolves on the wiki repo, and thewoocommerce_pos_item_is_on_salefilter table renders.:::info,:::tip,:::note) — confirm they render correctly.Known blockers
None — docs-only change.
🤖 Generated with Claude Code
Summary by CodeRabbit