Hi, (I hope this is the right place to post this) but...
I'm currently working on a website using Drupal 7 + Ubercart 3 and I have so far been unable to find a module to set products to be out of stock automatically once they have been sold.
But I did come across this thread http://drupal.org/node/384996 and in it someone suggests putting this in the theme...
function site_uc_product_add_to_cart( $node ) {
$stocklevel = uc_stock_level($node->model);
if (is_numeric($stocklevel)) {
// Stock tracking is active
if ($stocklevel <= 0) {
return '<div class="add-to-cart out-of-stock">' . t('Out of stock') . '</div>';
}
else {
return theme_uc_product_add_to_cart($node);
}
}
else {
// Stock tracking is not being used for this product, just show the add to cart button as normal
return theme_uc_product_add_to_cart($node);
}
}I think it was written for D6/UC2 and it doesn't work on my theme. So dose anyone know how to update it for D7/UC3?
Any help would be great.
Thanks in advance

