Добавляйте рейтинги, отзывы и модерацию товаров
A plugin that adds product review and moderation capabilities to your Medusa application, with built-in admin responses and review statistics.
This plugin is part of the Medusa Plugins Collection.
See a demo in our Medusa Starter
1yarn add @lambdacurry/medusa-product-reviews2
3# or, if you're using yarn workspaces4yarn workspace my-app add @lambdacurry/medusa-product-reviews1module.exports = defineConfig({2 plugins: [3 {4 resolve: '@lambdacurry/medusa-product-reviews',5 options: {6 defaultReviewStatus: 'pending', // OPTIONAL, default is 'approved'7 },8 },9 ],10});yarn medusa db:migrateFor detailed SDK setup and configuration, refer to the @lambdacurry/medusa-plugins-sdk README.
1// List product reviews2const { reviews, count } = await sdk.store.productReviews.list(3 query: StoreListProductReviewsQuery,4 headers?: ClientHeaders5);6
7// Create/Update a review8const review = await sdk.store.productReviews.upsert(9 data: StoreUpsertProductReviewsDTO,10 headers?: ClientHeaders11);12
13// Get review statistics14const stats = await sdk.store.productReviews.listStats(15 query: StoreListProductReviewStatsQuery,16 headers?: ClientHeaders17);1// List reviews2const { reviews, count } = await sdk.admin.productReviews.list(3 query: AdminListProductReviewsQuery4);5
6// Update review status7const review = await sdk.admin.productReviews.updateStatus(8 productReviewId: string,9 status: 'pending' | 'approved' | 'flagged'10);11
12// Manage review responses13const review = await sdk.admin.productReviews.createResponse(14 productReviewId: string,15 data: AdminCreateProductReviewResponseDTO16);17
18await sdk.admin.productReviews.updateResponse(19 productReviewId: string,20 data: AdminUpdateProductReviewResponseDTO21);22
23await sdk.admin.productReviews.deleteResponse(24 productReviewId: string25);Creation: Reviews are set to:
Moderation: Admins can:
IMPORTANT: A running PostgreSQL instance is required. The plugin expects and environment variables to be set. If not provided, both default to "postgres".
Available scripts:
1# Build the plugin2yarn build3
4# Development mode with hot-reload5yarn dev6
7# Publish to local registry for testing8yarn dev:publish9
10# Generate database migrations11yarn db:generateAfter publishing the plugin locally by running yarn dev:publish, go to the root of your Medusa project and run the following commands:
1cd path/to/your/medusa-application2
3yarn medusa plugin:add @lambdacurry/medusa-product-reviews4
5# If you are yarn with a monorepo, you may also need to run6yarn installThis plugin is compatible with versions of .
MIT License