Report In-Stock Configurable Products That Are Actually Out-of-Stock

configurable-productproduct-liststock

When all of a configurable product's associated products go out of stock, the configurable product's availability doesn't change. It'll stay listed as in-stock until you manually change it. (This is stupid, but default behavior.)

I'm looking to create a page that will list out all of these products for me. Basically, I'd like to create a page that shows all configurable products. Filter that list to show only products with in-stock status. And then filter that to show only ones that don't have any in-stock associated products (maybe with an isSaleable check).

Before I reinvent this particular wheel, has anyone built such a page?

Note: I found the opposite code, which may be helpful to someone: https://gist.github.com/arosenhagen/3844732 – This shows configurable products that are set to be 'out of stock' that have in-stock associated products.

Best Answer

I built the page - you can find it all in this gist: https://gist.github.com/sam327/11380448

Grabs all configurable products. Then sets up a table: Product Name, Magento ID, "Is Saleable" check, Stock Status (on the config product level), and Associated Product stock check.

I may revise the page to drop any items that are in-stock or out-of-stock across the board, so that it only lists the items that need human intervention. But this is good enough for my purposes.