Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 2.04 KB

File metadata and controls

84 lines (57 loc) · 2.04 KB

Medusa v2 Example: Bundled Products

This directory holds the code for the Bundled Products Tutorial.

You can either:

Prerequisites

Installation

  1. Clone the repository and change to the bundled-products directory:
git clone https://github.com/medusajs/examples.git
cd examples/bundled-products

2. Rename the .env.template file to .env.

3. If necessary, change the PostgreSQL username, password, and host in the DATABASE_URL environment variable.

4. Install dependencies:

yarn # or npm install

5. Setup and seed the database:

npx medusa db:setup
yarn seed # or npm run seed

6. Start the Medusa application:

yarn dev # or npm run dev

You'll find on the admin dashboard a "Bundled Products" page where you can create a bundled product.

Refer to the More Resources for OpenAPI Specs of custom API routes.

Copy into Existing Medusa Application

If you have an existing Medusa application, copy the following directories and files into your project:

  • src/admin
  • src/api
  • src/links
  • src/modules/bundled-product
  • src/workflows

Then, add the Bundled Product Module to medusa-config.ts:

module.exports = defineConfig({
  // ...
  modules: [
    {
      resolve: "./src/modules/bundled-product",
    }
  ],
})

Finally, run migrations:

npx medusa db:migrate

More Resources