Out of the box, M2 can manage stocks for you and does that with a single attribute that can either be In Stock or Out of Stock. That’s definitely better than nothing however it does not take into account products that are no longer available but still generate traffic to the site.
Adding another value to this attribute is a no go even from the development point of you if you are not crazy about rewriting product saving validations (good luck with that ;)).
A much better option is to create a new attribute altogether. Just create a new product attribute such as dropdown and add any values you fancy - In Stock, Out of Stock, Coming soon, Discontinued product, etc.
Attach this attribute to the product’s attribute set and you are almost there. You can now manually change the stock status in the admin and with a simple module, you can override the default template with stock on product detail and show this info instead.
That sounds almost too easy and it is definitely okay if you are maintaining only a couple of products. However, when your store gets bigger, manually handling and changing attributes (even with the bulk update option) is not feasible.
Rule-based custom status works similarly to catalog price rules. You define rules which product is having a custom status and then define this custom status based on the product’s quantity.
This is now fully automated and when the stock hits zero, based on an attribute you can show a specific message to the customer.
Sounds too good to be true? Don’t worry, we’ve got you covered! We have a free module for setting Custom stock status on: github.com/beecomprg
On the other hand you can also check out paid modules on Amasty or Magecomp
Yes, it is still a work in progress but it will get you going. If you like it or have any feedback for us, it would be great to hear from you on our Slack.
Enjoy and stay tuned for new and free modules from Beecom.