I'm trying to find a solution to use a double inventory where a different stock is being used based based on the user role. I know there are many easy solutions to limit the amount of products they can order at once, but this doesn't prevent them from placing another order. Ideally I would like to have a second inventory for each product which is used for a specific user role.
I've already been experimenting with a workaround where I add each product twice with a different inventory and show/hide the product based on user role. But this requires a lot of changes throughout the entire website to show/hide products from every page and element, not to mention all the links to product pages.
This is a very complex task. First, you need to display an additional input field in the Edit Product page:
Then, you need to save it:
Then, you need to filter stock quantity and status if the customer is logged in:
Finally, you need to reduce the correct stock on payment complete:
Totally untested and works with simple products only.