You can do this with some Liquid code, I would probably use variant.inventory_quantity (https://shopify.dev/docs/themes/liquid/reference/objects/variant), to check inventory levels.
Then if quantity < 3, you can either not show the add to cart button, or disable it and add some messaging.
If you prefer to hire out for this feel free to contact my team at speedboostr.com/contact, we do custom coding like this every day.
Another option, if you want to stop selling when out of stock but collect email addresses, you can use the app Now Back in Stock.
User | Count |
---|---|
49 | |
27 | |
25 | |
23 | |
23 |