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

Open to all! Ask other shopowners for help.
Post Reply
loop
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
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!


Join The Code Co-op to get access to your library in the Code Co-op Forum
loop
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
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
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
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
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 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
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
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)


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply