I am coding a basic category counting feature (like products_viewed but for categories). I have created a new field in the categories table called categories viewed and basically added this code to the main_template_vars.php file:
// new to count category views
$sql = "update " . TABLE_CATEGORIES . "
set categories_viewed = categories_viewed+1
where categories_id = '" . WHAT_VARIABLE_GOES_HERE . "'";
$res = $db->Execute($sql);
//eof new
I need to know which variable uses the respective category id. I have tried $cPath but that gives the category tree, I just want the actual category id - any ideas from those that know Zen Cart inside out?
Any help would be much appreciate as that is the only missing link I need :)



