@devx-commerce/plugin-wishlist
v0.0.5
Published
A starter for Medusa plugins.
Readme
What is Medusa Wishlist Plugin
This plugin provides wishlist functionality for your Medusa-powered e-commerce store. It enables customers to maintain a single wishlist per user account, helping them keep track of products they're interested in purchasing later.
Features
Core Functionality
- Single Wishlist per User: Each user gets one dedicated wishlist
- RESTful APIs:
Add Item: Add product to the wishlistRemove Item: Remove product from the wishlistClear Wishlist: Remove all product from the wishlistGet Wishlist: Retrieve the current wishlist products
Future Enhancements
We're planning to add the following notification features to enhance the wishlist experience:
- Stock Notifications: Alert users when wishlist items are back in stock
- Inventory Alerts: Notify users when wishlist items are running low
- Price Drop Alerts: Inform users when items in their wishlist decrease in price
These upcoming features will help users make informed decisions and never miss out on their desired products.
Prerequisites
- Medusa Application Version >= 2.4.0
Installation
- In your Medusa application, run the following command to install the wishlist plugin:
yarn add @devx-commerce/wishlist # or npm install @devx-commerce/wishlist- Add the plugin to the
pluginsarray inmedusa-config.ts:
module.exports = defineConfig({
// ...
plugins: [
{
resolve: "@devx-commerce/wishlist",
options: {}
}
]
})- Run the
db:migratecommand to run migrations and sync links:
npx medusa db:migrateCopy into your existing medusa application
You can also copy the source files into an existing Medusa application, which will add them not as a plugin, but as standard Medusa customizations.
- Copy the content of the following directories:
src/api/storesrc/api/middlewares.tssrc/linksrc/modules/wishlist
- Add the Wishlist Module to
medusa-config.ts:
module.exports = defineConfig({
// ...
modules: [
{
resolve: "./src/modules/wishlist"
},
]
})- Run the
db:migratecommand to run migrations and sync links:
npx medusa db:migrateTest it Out
To test out that the plugin is working, you can go to any product page on the Medusa Admin and see a Wishlist section at the top of the page. You can also try importing the OpenAPI Spec file and using the API routes added by this plugin.
More Resources
- Medusa Documentatin
- OpenAPI Spec file: Can be imported into tools like Postman to view and send requests to this project's API routes.
