I'm trying to add a in stock / out of stock label for all products on the category page. I've seen it on a lot of other webshops but haven't been able to figure out how.
Example of what I'm trying to achieve:
https://imgur.com/a/WMtvFO8
Find the list.phtml file which gets called in the category pages.
For example: app/design/frontend/rwd/default/template/catalog/product/list.phtml
Now, add the below code where you want to show label/status
<?php $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product); $qty = $stock->getQty(); if($qty <= 0) { ?> <span class="out-of-stock"><span>Sold Out</span></span> <?php } else { ?> <span class="in-stock"><span>In stock</span></span> <?php } ?>