woocommerce-pos
woocommerce-pos copied to clipboard
Out of stock products are entering into the checkout
I'm watching the demo and I could verify that when a product is out of stock it is still being added to the checkout, shouldn't the plus button be blocked or the product be removed from the list?
If this is not a bug and it is intentional please at least add it as an option in the configuration to disable this behavior.
I fixed this in 0.4.x by
- storing the managed_stock flag on each cached object
- doing an additional check stock api call to wc api on each add to cart catering for simple, variable and bundle (custom)
- deny action on less than 0 (avail stock - requested stock)
This ensures that the true stock count never comes from cache on add to cart. It does fix 99% of race conditions.
it it not the perfect solution , but has helped me. (2 in-store location pos and ecomm website running off a single woocommerce instance)
Having an action avail in the plugin to hook into that check would also allow for custom extentions, like bundles (which there are many of, you cant cater for them all)