0.2.0 • Published 5 months ago

medusa-wishlist-plugin v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Medusa v2 Example: Wishlist Plugin

This directory holds the code for the Wishlist Plugin Guide.

You can either:

Prerequisites

Installation

  1. In your Medusa application, run the following command to install the wishlist plugin:
yarn add medusa-plugin-wishlist # or npm install medusa-plugin-wishlist
  1. Add the plugin to the plugins array in medusa-config.ts:
module.exports = defineConfig({
  // ...
  plugins: [
    {
      resolve: "medusa-wishlist-plugin",
      options: {}
    }
  ]
})
  1. Add the following admin configuration in medusa-config.ts:
module.exports = defineConfig({
  // ...
  admin: {
    vite: () => {
      return {
        optimizeDeps: {
          include: ["qs"],
        },
      };
    },
  },
})
  1. Run the db:migrate command to run migrations and sync links:
npx medusa db:migrate

Copy into 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.

  1. Copy the content of the following directories:
  • src/api/store and src/api/middlewares.ts
  • src/link
  • src/modules/wishlist
  • src/workflows
  1. Add the Wishlist Module to medusa-config.ts:
module.exports = defineConfig({
  // ...
  modules: [
    {
      resolve: "./src/modules/wishlist"
    },
  ]
})
  1. Run the db:migrate command to run migrations and sync links:
npx medusa db:migrate

Test 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

0.2.0

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.0

5 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago