You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is this check necessary? canBackorder should always be true when inventoryPolicy is false or not present
It should be just: export default function canBackorder(variants) { return variants.every((variant) => !variant.inventoryPolicy); }
Further thinking
Maybe that check should be the opposite of the original:
only return false if inventoryManagement and inventoryPolicy are both true.
But currently, the product admin UI allows to set "Manage inventory" and "Allow backorder" independently, altough I would expect "Manage inventory
" turned of to grey out "Allow backorder" aswell.
But Im not sure what usecases might be there, maybe this is on purpouse?
For example someone needs to limit the quantity per order, which would be possible with that current implementation were both values are decoupled. <-- But this is still confusing and should, if necessary be implemented separately, as it is more of a trick using the current implementation.
Versions
v2.0.0-rc.11
The text was updated successfully, but these errors were encountered:
I believe it's always been this way, and until recently the UI did grey out. You bring up a good point, and I agree with the theory that they should not be related. The ability to backorder is currently tied in with the inventory plugin, but it should be more the concern of the product/catalog plugins. We'll have to see how easy it is to disentangle.
Fixed by #5164. Without inventory tracking enabled, the default behavior is now to allow purchasing any quantity. Also, #5186 adds a shop-specific setting that can be used to change this behavior. Some installations need untracked products to be considered sold out.
Issue Description
When inventoryManagement and inventoryPolicy are disabled for a variant, I am not allowed to order more than the available quantity.
I don't expect to have to turn on inventoryManagement to be able to allow backorders.
Steps to Reproduce
Please provide starting context, i.e. logged in as a user, configure a particular payment method.
Possible Solution
The issue happens during publish and is not related to the order process.
Catalog item does not have canBackorder = true as the check fails.
buildOrderItem
fails here, as canBackorder is missing:reaction/imports/plugins/core/orders/server/no-meteor/util/buildOrderItem.js
Line 29 in 6c8e806
createCatalogProduct
is using a separate funtion to determine wether canBackorder should betrue
:reaction/imports/plugins/core/catalog/server/no-meteor/utils/createCatalogProduct.js
Line 2 in 6c8e806
canBackorder
will only return if inventoryManagement istrue
:reaction/imports/plugins/core/catalog/server/no-meteor/utils/canBackorder.js
Line 9 in 6c8e806
Why is this check necessary?
canBackorder should always be true when inventoryPolicy is false or not present
It should be just:
export default function canBackorder(variants) { return variants.every((variant) => !variant.inventoryPolicy); }
Further thinking
Maybe that check should be the opposite of the original:
only return false if inventoryManagement and inventoryPolicy are both true.
But currently, the product admin UI allows to set "Manage inventory" and "Allow backorder" independently, altough I would expect "Manage inventory
" turned of to grey out "Allow backorder" aswell.
But Im not sure what usecases might be there, maybe this is on purpouse?
For example someone needs to limit the quantity per order, which would be possible with that current implementation were both values are decoupled. <-- But this is still confusing and should, if necessary be implemented separately, as it is more of a trick using the current implementation.
Versions
v2.0.0-rc.11
The text was updated successfully, but these errors were encountered: