How do I configure the Stock module in and know how many products are sold out of stock?
You can follow the below step:


Go to  Content management -> Content
Filter content for content type "Product"
Edit your product content
Click on "stock" link in top of page
Set the "Stock" and "Threshold" quantity and check "active" check-box save the form.


Edit:

Code snippets to display total and sold item from stock:

$output = '';

$array_sku = uc_product_get_models($node-&gt;nid, FALSE);

foreach ($array_sku as $sku) {
  $stock_level = uc_stock_level($sku);
  $stock_count = db_select('uc_order_products', 'up')-&gt;fields('up', array('nid'))-&gt;condition('up.model', $sku, '=')-&gt;execute()-&gt;rowCount();

  $total = $stock_level +  $stock_count;

  $output .= "&lt;div&gt;SKU:" . $sku . " Total :" . $total . ", Sold out:" . $stock_count . "&lt;/div&gt;";

}


print $output;


Kindly see that above code will be check stock level for each different SKU of the product. If there is attribute of the product and each attribute has different SKU, then it will display the stock for each sKU of the product.

You can add this code in node--product.tpl.php file in your theme directory.