| ||||||||||
| Shopping cart software Solutions for online shops and malls | ||||||||||
|
|
||||||||||
| X-Cart Home |
Retreive Cat ID from current product page | |||
![]() |
|
||
|
|
Thread Tools | Search this Thread |
|
#1
|
|||||||
|
|||||||
|
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
__________________
X-Cart version 4.4.3 |
|||||||
|
#2
|
|||||||||
|
|||||||||
|
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
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#3
|
|||||||
|
|||||||
|
But I seem to be able to echo the current category just fine with
{$current_category.categoryid}
__________________
X-Cart version 4.4.3 |
|||||||
|
#4
|
|||||||||
|
|||||||||
|
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
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#5
|
|||||||||
|
|||||||||
|
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.
---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
|
|
|||
|
X-Cart forums © 2001-2020
|
|||