Thanks so much for this code snippet. I was using http://drupal.org/project/uc_out_of_stock, but the ajax made my site run slow on the grid product pages.
This seems like a much more efficient and easy way to do what I wanted, and the bonus is that I'm able show a status of "In Stock" on my product page.
