Sorry if this is the wrong place to post this but I'm a little bit stuck.
I'm currently developing for a store who is trying to implement a feature where after an item is sold out, it goes into pre-order. However, it's limited to a certain amount of quantity. Can someone point me in the right direction. I've been trying to look for more details on this but it doesn't seem like anyone has asked or implemented this yet.
For example, there is currently a t-shirt that has 50 in-stock. Once the 50 t-shirts are sold out, it goes into pre-order. But there is only 20 t-shirts in the next shipment. So, I want to limit the t-shirts preorders to 20 only.
I know about the variant setting "continue selling when out of stock" and how it returns variant.inventory_policy continue but I'm not sure how to control the amount being sold.
I have the idea of allowing orders to continue after sold out and disabling the pre-order button after its at -20 or something but I'm pretty sure that probably not the right approach to this as it also doesn't alter the behavior in cart and would let customers order more than the -20 quantity number.