Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Inventory system fails with shared inventory items #10919

Open
Midunas opened this issue Jan 11, 2025 · 2 comments
Open

[Bug]: Inventory system fails with shared inventory items #10919

Midunas opened this issue Jan 11, 2025 · 2 comments

Comments

@Midunas
Copy link

Midunas commented Jan 11, 2025

Package.json file

{
    "name": "medusa-starter-default",
    "version": "0.0.1",
    "description": "A starter for Medusa projects.",
    "author": "Medusa (https://medusajs.com)",
    "license": "MIT",
    "keywords": [
      "sqlite",
      "postgres",
      "typescript",
      "ecommerce",
      "headless",
      "medusa"
    ],
    "scripts": {
      "build": "medusa build",
      "seed": "medusa exec ./src/scripts/seed.ts",
      "start": "medusa start",
      "dev": "medusa develop",
      "migrate": "medusa db:migrate"
    },
    "dependencies": {
      "@medusajs/admin-sdk": "2.2.0",
      "@medusajs/cli": "2.2.0",
      "@medusajs/framework": "2.2.0",
      "@medusajs/link-modules": "^2.2.0",
      "@medusajs/medusa": "2.2.0",
      "@mikro-orm/core": "5.9.7",
      "@mikro-orm/knex": "5.9.7",
      "@mikro-orm/migrations": "5.9.7",
      "@mikro-orm/postgresql": "5.9.7",
      "awilix": "^8.0.1",
      "pg": "^8.13.0"
    },
    "devDependencies": {
      "@medusajs/test-utils": "2.2.0",
      "@mikro-orm/cli": "5.9.7",
      "@swc/core": "1.5.7",
      "@swc/jest": "^0.2.36",
      "@types/jest": "^29.5.13",
      "@types/node": "^20.0.0",
      "@types/react": "^18.3.2",
      "@types/react-dom": "^18.2.25",
      "jest": "^29.7.0",
      "prop-types": "^15.8.1",
      "react": "^18.2.0",
      "react-dom": "^18.2.0",
      "ts-node": "^10.9.2",
      "typescript": "^5.6.2",
      "vite": "^5.2.11"
    },
    "engines": {
      "node": ">=20"
    },
    "packageManager": "[email protected]+sha512.5383cc12567a95f1d668fbe762dfe0075c595b4bfff433be478dbbe24e05251a8e8c3eb992a986667c1d53b6c3a9c85b8398c35a960587fbd9fa3a0915406728"
  }

Node.js version

v23.5.0

Database and its version

PostgreSQL 17.2

Operating system name and version

macOS 15.2

Browser name

Google Chrome

What happended?

Getting error: "Variant variant_XXXXXXX does not have any inventory items associated with it" when placing order with 2 variants of the same product. Despite the product variants being linked to the same inventory item.

Setup

  • Multiple variants (1 bottle, 2 bottles, 3 bottles packs)
  • All variants linked to same inventory item (since they're the same physical product)
  • Trying to place order with different variants in cart.

Expected behavior

  • Should allow adding multiple variants that share the same inventory item
  • Should allow ordering multiple variants that share the same inventory item
  • Should expose inventory_item data to fulfillment module to allow correct shipping information with quantity

Actual behavior

Getting mentioned error.
Cart becomes unusable with error: "Cart cart_XXXXX is already completed"
System doesn't handle multiple variants sharing the same inventory item pool

Any suggestions how to move forward with my case are welcome!

Thank you.

@joekendal
Copy link
Contributor

I thought variant should be 1-to-1 with inventory item. You are doing many-to-1 why?

@joekendal
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants