-
Notifications
You must be signed in to change notification settings - Fork 342
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 "IsSaleable" special attribute for optimizers #2637
base: 2.10.x
Are you sure you want to change the base?
Conversation
Hi @vseager Please see my comments. I don't really understand the point of doing this like that. Your "is saleable" is equivalent to our "only in stock products" => we should keep our legacy as is. I dont think "stock.qty > 0 and stock.is_in_stock=true" should be a dedicated special attribute. I'd rather go with introducing a new special attribute based only on stock.qty. However, it will not work for configurable products as their stock.qty is always 0 (thanks to Magento for this). |
@romainruaud Thanks for your comments.
This is correct, it was really down to the terminology being understandable by the user. as "In Stock Products" to most administrators (not programmers) would imply the item is physically in stock, on the shelf (and doesn't require backorder).
A stock.qty option is of course a perfectly good alternative solution. |
A product with |
Resolves #2618 .
Currently if you use the "Only in stock products" rule in an optimizer when you have backorders enabled, you don't get the expected results.
To be able to backorder a product it needs to be set to "In Stock" even if the quantity is 0.
This means that products which are available to order but not physically in stock are currently prioritised in the optimizer and there is no way to prioritise ONLY product which are physically in stock and ready to ship.
This PR achieves two things:
IsInStock
special attribute to return products which are both set to "In Stock" and have aqty
greater than0
.IsSaleable
special attribute which returns all "In Stock" products regardless of qty.