Medusa Wishlist provides functionality which stores wishlist items in a list, which can be then shared with others.
- Install plugin by adding to your
package.json
:
...
"@rsc-labs/medusa-wishlist": "0.0.3" // or other available version
...
and execute install, e.g. yarn install
.
- Add plugin to your
medusa-config.js
:
...
plugins: [
{
resolve: "@rsc-labs/medusa-wishlist",
options: {}
}
]
...
or
...
plugins: ["@rsc-labs/medusa-wishlist"]
...
Medusa Wishlist introduces new models in database. To have it working, you need to firstly execute migrations:
npx medusa db:migrate
You can copy the code from /src into your Medusa project.
Add module to medusa-config.js
:
{
resolve: "./modules/wishlist",
}
Update your package.json
:
"dependencies": {
...
"jsonwebtoken": "^9.0.2"
}
Medusa Wishlist introduces new models in database. To have it working, you need to firstly execute migrations:
npx medusa db:migrate
Everything is covered by the API definition - details are here: Store API.
In short - every customer has wishlist entity created automatically when first item is being added. Items can added, updated (e.g. by quantity) or deleted. Wishlist can be shared by using token.
Sharing functionality uses JWT to generate a token. To have it properly working, you shall set jwtSecret
in options, e.g.:
{
resolve: "@rsc-labs/medusa-wishlist",
options: {
jwtSecret: 'supersecret'
}
}