PDA

View Full Version : Parent ID DEEP in the code structure


Andy
15-06-07, 18:45
Hello

Im on the cusp of doing something i never thought possible. After nearly a full week of developing, Ive hit my final snag

I need to get the parent category ID of the product Im looking at. The code Im using isn't fired up until product_display.php, but by then the parent ID is well and truely written over.

The nearest i can get to is the second ID in the breadcrumb (by using: $oCategory->iParentId), But thats more of a child.

Anyone got any ideas?

authcode
16-06-07, 07:28
I haven't checked this (and I've just woken up!) but isn't the parent category of a category the first member of the category tree return?
I.e
getCategoryTree(productCategoryId)
parentCategoryId = getCategoryTreeReturn[0]