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

Cannot add backorderable products to cart in admin #2522

Closed
mdamian322 opened this issue Jan 23, 2018 · 3 comments
Closed

Cannot add backorderable products to cart in admin #2522

mdamian322 opened this issue Jan 23, 2018 · 3 comments
Labels
type:bug Error, flaw or fault

Comments

@mdamian322
Copy link
Contributor

Steps to reproduce

  1. Have a product that has 0 stock but is backorderable
  2. Create a new order in admin
  3. On the cart tab, search for that product in order to add it to the cart
  4. No results come up

Expected behavior
I expect the product to come up in search so I can add it to the customer's cart since it's backorderable. On the frontend, the customer is able to purchase it just fine.

Actual behavior
The product does not show up and I am not able to add it to the cart.

System configuration
2.4

@jhawthorn jhawthorn added the type:bug Error, flaw or fault label Jan 23, 2018
@jhawthorn
Copy link
Contributor

jhawthorn commented Jan 23, 2018

Can confirm this issue. The problem is that most of our admin variant selectors use in_stock_only: true. Our terminology in the API and core is that in_stock means essentially count_on_hand > 0 || !track_inventory?.

We should introduce a new scope to mean any variant which we could put in an order: count_on_hand > 0 || backordered? || !track_inventory?.

I have no idea what to call this scope. Any suggestions?

can_supply? is probably the nearest match. So maybe something named similarly to that?

@skukx
Copy link
Contributor

skukx commented Jan 24, 2018

I like the idea of can_supply? or close to that (can_dispurse?, can_fulfill?, can_allocate?) and the name makes sense for the functionality it will provide. Items that are in stock, or backorderable, or don't require tracking. Possibly add a scope to the variant called suppliable to go with the in_stock scope.

Spree::Variant.in_stock
Spree::Variant.suppliable

See: https://github.com/solidusio/solidus/blob/master/api/app/controllers/spree/api/variants_controller.rb#L70

@jhawthorn
Copy link
Contributor

I believe this is fixed by #2536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error, flaw or fault
Projects
None yet
Development

No branches or pull requests

3 participants