I'm writing come custom code, but I can't seem to find a way to get the current cpath. I would like to get the number for current cpath as well as current top level parent category.
Can someone help?
Thanks,
TJ
I'm writing come custom code, but I can't seem to find a way to get the current cpath. I would like to get the number for current cpath as well as current top level parent category.
Can someone help?
Thanks,
TJ
$_GET[cPath]
will deliver the current cPath.
For the current parent category,
(int)$_GET[cPath]
will strip any underscores and following subcat numbers from cPath, leaving only the top cat id.
You may want to check for the value being not null - if no category is selected, you will get null or 0.
Last edited by gjh42; 30 Aug 2008 at 11:27 PM.
Note: to know the immediate categories path you can use:
$current_category_id
Often times, when you do not "see" cPath, $current_category_id will know the immediate categories_id of the immediate path that you are in ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!