Ecommerce Product Reviews
Adds product reviews and aggregate ratings to a Payload ecommerce shop, with verified-purchase detection and moderation before reviews go public.
Installation
pnpm add payload-reviews About
This plugin adds a reviews collection and two aggregate rating fields to a shop built with `@payloadcms/plugin-ecommerce`. It extends the ecommerce plugin rather than replacing it: the products collection gains `ratingAverage` and `ratingCount` fields, and a new `reviews` collection holds the rows that feed them. Reviews carry a product relationship, a rating between 1 and a configurable maximum, a title, a body, an author name and email, plus a `verifiedPurchase` flag and a `status` of pending, approved or rejected. The verified-purchase flag is computed, not self-reported. On every write that could change it, the plugin runs a single count query against the orders collection for an order whose status is in the configured purchase statuses (processing or completed by default), that carries the reviewed product on one of its lines, and that belongs to the reviewer either through a customer relationship or a customer email. An order belongs to a signed-in customer or carries an address, never both, so the query matches on either half. `cancelled` and `refunded` orders do not count. The aggregate rating is never incremented or decremented. Each time a review is created, changed or deleted, the product's rating is recounted from the approved rows in the `afterChange` and `afterDelete` hooks, running inside the same transaction as the triggering write. Count queries on indexed columns produce the number of reviews and the sum of ratings exactly, with no drift and no truncation. A rebuild endpoint recounts every product and accepts a bearer secret for unattended runs. Reading is public but narrowed: anyone who does not pass the admin access rule sees only approved reviews, through REST, GraphQL or the local API. Creating is open by default, while updating and deleting are closed to the admin rule. A submitter cannot approve their own review or set their own verified flag. Options cover the access rules, field and collection slugs, maximum lengths, the rating scale, whether to refuse a second review of the same product by the same person, and a `disabled` switch that stops the logic while leaving the schema intact.
Package info
- Package name
payload-reviews- Latest version
1.0.1- Unpacked size
- 39 kB
- License
- MIT
- Weekly downloads
- 11
- Last publish
- Aug 21, 2026
More from Poseidonas
View profileBarcodes
Adds Code 128, EAN-13 and QR code generation to Payload product collections with a printable label page and optional admin print buttons.
AI Manager
Writes product titles, descriptions, attributes and translations into Payload fields via Claude, ChatGPT, Gemini or Kimi, and skips content it already generated.
EU VAT
Records EU VAT on Payload ecommerce orders: country rates, B2B reverse charge, VIES validation, and OSS reporting totals.
Stock Reservation
Validates variant stock and price before checkout and holds reserved inventory until payment settles, extending the official Payload ecommerce plugin.
Stock Alerts
Sends a shop one email when product or variant inventory crosses a low stock threshold, with backorder handling and a storefront-readable status field.
Shipping Rates
Adds shipping zones, rate calculation, and a quote endpoint to Payload ecommerce shops.
Similar plugins
More in CommerceStripe
Syncs Payload collections with Stripe resources and routes Stripe webhooks and API calls through Payload.
Tpay E-commerce Payment Adapter
Adds BLIK, bank transfer and card payments through Tpay to Payload's e-commerce plugin, with webhook verification and stock-aware order confirmation.
Google Merchant Center Ecommerce Integration
Sync products with Google Merchant Center from Payload CMS.