Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / help finding Category Variable please :)

help finding Category Variable please :)

Locked

Views: 1,031

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
15 Aug 2009, 11:52 AM
#1
ink avatar

ink

Zen Follower

Join Date:
Jul 2004
Posts:
140
Plugin Contributions:
0

help finding Category Variable please :)

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 :)

15 Aug 2009, 12:02 PM
#2
ink avatar

ink

Zen Follower

Join Date:
Jul 2004
Posts:
140
Plugin Contributions:
0

Re: help finding Category Variable please :)

Booyakashah............ $current_category_id is the badboy needed