Плагин Medusa для нескольких продавцов
This plugin transforms your Medusa store into a robust multivendor marketplace.
The plugin was created as a result of a four-part series articles on Medium re how to create multivendor marketplace with Medusa 2.0:
Add plugin:
yarn add @techlabi/medusa-marketplace-pluginAdd the following variables to your file:
1API_KEY=supersecret2VITE_BACKEND_URL=http://localhost:9000Apply patch:
To ensure proper setup, follow these steps:
Open : Open the file in your project's root directory.
Add script: Add the following script under the section:
1"scripts": {2 "postinstall": "node node_modules/@techlabi/medusa-marketplace-plugin/.medusa/server/src/patch-admin.js",3 // ... other scripts ...4}Run installation: Execute the installation process using yarn:
yarnThis script will automatically execute after all dependencies are installed, applying the necessary patch.
Add the following code to your file:
1module.exports = defineConfig({2 projectConfig: { ... },3 plugins: [4 {5 resolve: "@techlabi/medusa-marketplace-plugin",6 options: {},7 },8 ],9})This code connect plugin and helps to resolve an issue similar to https://github.com/medusajs/medusa/issues/11248.
Run database migrations:
npx medusa db:migrateStart the project:
yarn dev1admin: {2 vite: config => {3 config.define["__VITE_DISABLE_SIGNUP_WIDGET__"] = JSON.stringify(true);4 },5 },https://github.com/Tech-Labi/medusa2-marketplace-demo
Key features included:
To create a super admin, use the following request:
curl -X POST http://localhost:9000/stores/super -d '{ "email":"admin@test.com", "password": "supersecret"}' -H 'Content-Type: application/json' -H 'Authorization: supersecret'Feel free to contribute to this plugin by submitting pull requests or creating issues for bug reports and feature requests.
Apache 2.0