Maybe this is usefull to somebody:
It displays a small table with the current stocklevel of all stock-enabled SKU's for a product.
<?php
if ($node->type == 'product') {
$arr_sku = uc_stock_skus($node->nid);
$stock_html .='<table>';
foreach($arr_sku as $sku){
$stocklevel = uc_stock_level($sku);
if ($stocklevel) {
if ($stocklevel < 1) {
$stocklevel = '<span class="nostock">'.$stocklevel.'</span>';
}
$stock_html .='<tr><td>'.$sku.'</td><td>: '.$stocklevel.'</td></tr>';
}
}
$stock_html .='</table>';
}
?>Put it in the node.tpl.php, and print the var $stock_html in a proper place.
Feel free to ask.
Regards,
Kees



Joined: 08/13/2007