Currently I need to display out of stock options for configurable products in the products drop down. For example, a configurable product might have the following options: Small, Medium, Large.
When an option is out of stock, it still needs to display in the configurable products drop down, it just needs to be greyed out.
This can be achieved by enabling the following setting:
Stores > Configuration > Inventory > Display Out of Stock Products > Yes
The problem is that this configuration setting also enables out of stock products to display on both category pages and in search results.
How can I display out of stock options for configurable products, without showing out of stock products in categories and search results?