how to get cPath out of categories_id (without tep_get_path = db Queries)

Ask the community for help and support.
Post Reply
loop
VIP Member
VIP Member
Posts: 230
Joined: Thu Mar 25, 2021 12:26 pm
Has thanked: 7 times
Been thanked: 3 times

how to get cPath out of categories_id (without tep_get_path = db Queries)

Post by loop »

Hi All
i want to have the complete cPath from the categories_id and i'm wondering if that's possible, without use function tep_get_path($current_category_id = '')

I need a solution to use in productlisting, to have a link back to the according category and i do not want to query for every link the DB (that would create to much DB traffic)

thank you in advance!
loop
VIP Member
VIP Member
Posts: 230
Joined: Thu Mar 25, 2021 12:26 pm
Has thanked: 7 times
Been thanked: 3 times

Re: how to get cPath out of categories_id (without tep_get_path = db Queries)

Post by loop »

or ist the best way to use:
$ancestors = $GLOBALS['category_tree']->get_ancestors($category_id);
and thenn make the cpath with a foreach?

thank you
loop
VIP Member
VIP Member
Posts: 230
Joined: Thu Mar 25, 2021 12:26 pm
Has thanked: 7 times
Been thanked: 3 times

Re: how to get cPath out of categories_id (without tep_get_path = db Queries)

Post by loop »

I would really appreciate the best solution on how to get from the categories_id to the cPath
can somebody help me here out?
heatherbell
VIP Member
VIP Member
Posts: 1996
Joined: Mon Oct 07, 2019 4:39 am
Has thanked: 26 times
Been thanked: 175 times

Re: how to get cPath out of categories_id (without tep_get_path = db Queries)

Post by heatherbell »

loop wrote: Tue Oct 05, 2021 5:36 am can somebody help me here out?
One of the benefits of being a Pro Supporter is that you can post questions in the VIP PRO Supporters forum where help and support direct from the Core Developers is available. Maybe they can help.
loop
VIP Member
VIP Member
Posts: 230
Joined: Thu Mar 25, 2021 12:26 pm
Has thanked: 7 times
Been thanked: 3 times

Re: how to get cPath out of categories_id (without tep_get_path = db Queries)

Post by loop »

ok, will do that (i thought the pro supporters forum is only for the addons)
Post Reply