X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Retreive Cat ID from current product page (https://forum.x-cart.com/showthread.php?t=61121)

makenoiz 10-05-2011 04:29 PM

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

cflsystems 10-05-2011 07:44 PM

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

makenoiz 10-05-2011 09:00 PM

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}

cflsystems 10-06-2011 05:02 AM

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

gb2world 10-06-2011 11:44 AM

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.