Mark products with inventory enabled on product listing page

Hi there,

I've done this before but can't figure out how to do it again since updating things, and could use some help: On this page of my dad's art website, for every original painting (product) he's sold, we put a red box near that painting's thumbnail image to basically say the original is sold but prints of that product are still available. (He handles orders offline but wants people to know when they visit his site, which originals have sold and which ones haven't). I added the box by checking/enabling the inventory for that painting and leaving it zero. If an original is still available on the other hand, we simply leave the inventory box unchecked/disabled for that product.

I think I originally added the red box with a new function that said, if inventory is enabled and it's value is zero, then add a span to that product's content. Then I stylized the added span to look like a red box.

This is what I have so far, added to /themes/framemarket/library/functions/marketpress.php and it's not working.... It's not pulling in the inventory value:

added around line 43:

function mp_product_stock_sc( $atts ){
    global $post;
    $product_id = $post->ID;
    $stock = get_post_meta($product_id, 'mp_inventory', true);
    //return $stock[0];

    if ($stock[0] == 0 ) {
        return $stock[0];
    } else {
		return '';
    }
}

added around line 277:
$product_content .= '<span class="original-sold">' . mp_product_stock_sc( $atts ) . '</span>';

The span is getting added where I want it, but I can't seem to pull in the '0' inventory value. How do I get it??

Thanks!