Downloads
**EDIT**
modules/uc_product/uc_product.module
**FIND**
if (module_exists('uc_cart')) {
$node->content['add_to_cart'] = array('#value' => theme('uc_product_add_to_cart', $node, $teaser, $page),
'#access' => $enabled['add_to_cart'],
'#weight' => $weight['add_to_cart'],
);
}**CHANGE TO**
if (module_exists('uc_cart')) {
$stock_level = db_result(db_query("SELECT stock FROM {uc_product_stock} WHERE nid = $node->nid"));
if ((integer)$stock_level > 0) {
$node->content['add_to_cart'] = array('#value' => theme('uc_product_add_to_cart', $node, $teaser, $page),
'#access' => $enabled['add_to_cart'],
'#weight' => $weight['add_to_cart'],
);
} else {
$context['subject']['field'] = 'add_to_cart';
$context['class'] = array('add_to_cart');
$node->content['add_to_cart'] = array('#value' => '<strong>**Out of Stock</strong>', '#cell_attriubtes' => array('nowrap' => 'nowrap'));
}
}If someone wants to actually make this more than a basic hand patch.. or add it into core with some options.. that would be great.




