hook_uc_add_to_cart in template I'm using Drupal 7 + Ubercart 3 and am trying to run a piece of code just before the user adds a product in cart. hook_uc_add_to_cart seems to be the right function to use for it. So I'm trying to utilize it using the following syntax in template.php file of my template  

function tbw_uc_add_to_cart($nid, $qty, $data){die('here: ' . $qty);}


where tbw is my template name. I've flushed all caches but the above code does not work as it doesn't die() when I add a product to cart. I suspect the problem is that this hook can't be implemented in a template because the documentation only talks about using it inside a module, i.e., Some modules need to be able to hook into the process of adding items to a cart....
Can anybody please shed some light on why it is not working and guide me in the right direction. Thanks.
I suspect the problem is that this hook can't be implemented in a template


Correct :) 

Only hook_theme(), preprocess hooks, and alter hooks can be implemented in template.php. For any others, including this one, you'll need to write a custom module.