How to diasplay stock quantity of goods in node-product.tpl.php I need to get quantity of goods in stock and display a number in the product page node-product.tpl.php.

Here is what I added in the template, but uc_stock_level() seems not to work properly.

$stock = uc_stock_level($node-&gt;model);   
if ($stock &gt; 0) {
    print $stock;
} else {
    print $stock;
}


I am using Ubercart 2.
There is not much to uc_stock_level(). Check that you are supplying a model/SKU that is in the table and it is active. If that's the case, you might need to flush your cache to pick up new changes in your template file.