![]() |
Retreive Cat ID from current product page
I know this is a silly question but on a product page how would I echo the current categorys parent category ID? I have some code that is not working and its based on the parent category ID of the current product.
Thanks for your help. This will help with my logic |
Re: Retreive Cat ID from current product page
You have to query the categories table for the parentid for that product's category in php and assign it to smarty. It is a product details page so there is no current category, there is no category
|
Re: Retreive Cat ID from current product page
But I seem to be able to echo the current category just fine with
{$current_category.categoryid} |
Re: Retreive Cat ID from current product page
On product details page? Imposible unless you have some customization. $current_category doesn't exist on product details page by default. It does on product list pages (category pages).
{$current_category.parentid} will be the code to call parent category id if $current_category array exists |
Re: Retreive Cat ID from current product page
You can get information on the product page about an item's main category, and its parent categories. In webmaster mode, select show variables, and look at the $location array. This is what displays the breadcrumb.
--- |
All times are GMT -8. The time now is 11:08 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.