A plugin that enables customer product reviews for your Medusa store.
If you are not familiar with Medusa, you can learn more on the project web site.
A plugin that enables customer product reviews for your Medusa store.
yarn add medusa-product-reviews
or
npm i medusa-product-reviews
medusa-config.js
, add the plugin to the plugins
array and set
enableUI
const plugins = [
// ... other plugins
{
resolve: `medusa-product-reviews`,
options: {
enableUI: true
}
}
]
npx medusa migrations run
(see: https://docs.medusajs.com/development/entities/migrations/overview)
as the plugin uses new tables.GET /store/product-reviews
order_id
: (Optional) Filters reviews by a specific order.product_id
: (Optional) Filters reviews by a specific product.customer_id
: (Optional) Filters reviews by a specific customer.rating
: (Optional) Filters reviews by a specific rating.limit
: (Optional) Number of reviews to return.offset
: (Optional) Number of reviews to skip before starting to return
results.{
"reviews": [
{
"id": "string",
"product_id": "string",
"customer_id": "string",
"order_id": "string",
"rating": 5,
"content": "Great product!",
"images": ["image1.jpg", "image2.jpg"],
"created_at": "2023-08-24T12:34:56.789Z",
"updated_at": "2023-08-24T12:34:56.789Z"
}
],
"count": 1
}
GET /store/product-reviews/stats
product_id
: (Required) The product ID for which to retrieve statistics.
{
"stats": {
"product_id": "string",
"average": 4.5,
"count": 10,
"by_rating": [
{ "rating": 5, "count": 6 },
{ "rating": 4, "count": 3 },
{ "rating": 3, "count": 1 }
]
}
}
POST /store/product-reviews
product_id
: (Required) The ID of the product being reviewed.order_id
: (Required) The ID of the order associated with the review.
rating
: (Required) The rating given to the product.content
: (Optional) The content of the review.images
: (Optional) An array of image URLs or files associated with the
review.{
"review": {
"id": "string",
"product_id": "string",
"customer_id": "string",
"order_id": "string",
"rating": 5,
"content": "Great product!",
"images": ["image1.jpg", "image2.jpg"],
"created_at": "2023-08-24T12:34:56.789Z",
"updated_at": "2023-08-24T12:34:56.789Z"
}
}
POST /store/product-reviews/:product_review_id
product_id
: (Required) The ID of the product being reviewed.order_id
: (Required) The ID of the order associated with the review.
rating
: (Required) The rating given to the product.content
: (Optional) The updated content of the review.images
: (Optional) An array of updated image URLs or files associated
with
the review.{
"review": {
"id": "string",
"product_id": "string",
"customer_id": "string",
"order_id": "string",
"rating": 5,
"content": "Updated review content.",
"images": ["image1.jpg", "image2.jpg"],
"created_at": "2023-08-24T12:34:56.789Z",
"updated_at": "2023-08-24T12:34:56.789Z"
}
}
GET /admin/product-reviews/stats
product_id
: (Required) The product ID for which to retrieve statistics.
GET /admin/product-reviews
GET /store/product-reviews
endpoint.
POST /admin/product-reviews/:product_review_id
reply
: (Required) The updated reply to the review.DELETE /admin/product-reviews/:id
{
"success": true
}
product-reviews: {
"id": "string",
"product_id": "string",
"customer_id": "string",
"order_id": "string",
"rating": 5,
"content": "Great product!",
"reply": "Thank you for your feedback!",
"images": ["image1.jpg", "image2.jpg"],
"created_at": "2023-08-24T12:34:56.789Z",
"updated_at": "2023-08-24T12:34:56.789Z",
"deleted_at": null
}
If you have an idea for what could be the next highest priority functionality, do not hesitate to raise an issue here: Github issues.
The Pro version of medusa-product-reviews expands on the features of the free version with more advanced capabilities such as:
The Pro version is available under a commercial license. Contact abdullah-afzal for more information.
We show what advanced features we offer in the "Pro version" tab. We try to keep it non-intrusive, but if you feel otherwise, you can always hide this tab by setting the following environment variable:
MEDUSA_ADMIN_PRODUCTS_REVIEWS_HIDE_PRO=true
After restarting your admin application, this tab will be hidden.