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

Add Product to cart with managed inventory and allow backorders #8716

Closed
420coupe opened this issue Aug 22, 2024 · 0 comments
Closed

Add Product to cart with managed inventory and allow backorders #8716

420coupe opened this issue Aug 22, 2024 · 0 comments

Comments

@420coupe
Copy link
Contributor

420coupe commented Aug 22, 2024

Bug report

Describe the bug

When trying to add an item to the cart that has managed inventory true and allow backorders true, providers the following error below.

error: Some variant does not have the required inventory

The issue is table product_variant_inventory_item.required_quantity needs to be updated to 0 when allow_backorders is set to true. I manually converted the value to 0 in the database and was able to add the item to the cart.

System information

Medusa version (including plugins): @medusajs/medusa@npm:1.20.6-preview-20240819150500 (via preview)
Node.js version: v21.7.1
Database: Supabase (postgres)
Operating system: Ubuntu 22.04.4
Browser (if relevant):

Steps to reproduce the behavior

  1. Stand up V2 backend and setup configs
  2. Add digital products following v2 example
  3. Add product to cart, unable to add.
  4. See error

Optional
5. change backend table product_variant_inventory_item.required_inventory to 0
6. add product to cart -> now works as expected

Expected behavior

Be able to add item to cart when allow_backorders = true then required_inventory = 0

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

1 participant