This guide walks you through installing @webbycrown/medusa-quantity-pricing-rules on a Medusa v2 backend. Installation requires brief terminal access – share this guide with your developer if you use a hosted Medusa setup.
Prerequisites
Before installing, confirm your environment meets these requirements:
| Requirement | Details |
|---|---|
Medusa |
v2.13 or newer |
Node.js |
Version 20 or higher |
Database |
PostgreSQL (standard for Medusa) |
Access |
Ability to edit |
Step-by-Step
Install the package
Open a terminal in your Medusa backend project root (not your storefront):
npm install @webbycrown/medusa-quantity-pricing-rules
Or with yarn:
yarn add @webbycrown/medusa-quantity-pricing-rules
Register the plugin
Add the plugin to medusa-config.ts:
import { defineConfig } from "@medusajs/framework/utils"
export default defineConfig({
plugins: [
{
resolve: "@webbycrown/medusa-quantity-pricing-rules",
options: {},
},
],
})
Warning Register the plugin under plugins only . Do not add a duplicate entry under modules – the pricingEngine module registers automatically.
Run migrations
The plugin creates the quantity_prices table:
npx medusa db:migrate
Start Medusa
Development:
npm run dev
Production:
npm run build
npm run start
Verify installation
Use this checklist to confirm everything works:
| Step | What to check |
|---|---|
1 |
Log in to Medusa Admin |
2 |
Go to Settings → Extensions → Quantity Pricing |
3 |
Click Add rule and create a test tier on a product |
4 |
Open Products → [product] and confirm the Quantity pricing widget |
5 |
Go to Settings → Store and see the Quantity pricing engine widget |
Environment variables
No plugin-specific environment variables are required. Your standard Medusa .env (including DATABASE_URL) is sufficient.
Upgrading
When a new version is released:
npm install @webbycrown/medusa-quantity-pricing-rules@latest
npx medusa db:migrate
npm run buildRestart Medusa and verify existing rules still appear in Admin.
Common installation issues
| Issue | Possible cause | Solution |
|---|---|---|
Menu missing in Admin |
Plugin not registered |
Check |
Migration failed |
Database out of date |
Run |
Module not found |
Wrong config location |
Plugin under |
Admin page blank |
Stale build |
Rebuild plugin, restart backend |
npm install fails |
Node too old |
Upgrade to Node 20+ |
Post-installation checklist
- [ ] Package in
package.json - [ ] Plugin in
medusa-config.ts - [ ] Migrations completed
- [ ] Admin Quantity Pricing page loads
- [ ] Test rule created
- [ ] Product widget visible
- [ ] Storefront team notified to integrate Store API