Page 1 of 1

Retrieve full category tree?? Help needed

Posted: Wed Feb 21, 2018 10:34 pm
by pablormago
Hi to all!!
I am in the early stage on developing a Mod. Its easy and simple, but i cant find a way to resolve a problem.

I need to fill a dropdown with the full category tree, like this:

- Category 1
- Category 1 - SubCat 1
- Category 1 - SubCat 2 - SubCat 1
- Category 2
And so...
I couldnt find an OC function for this, i also tried to code some php script, but i only achieved to get the full list of categories, without order and without a tree looking.

Is there an OC function y forgot?? Is there any Sql statement that could help me? I know the category_path table is there, but im completely stucked!!

Thanks in advance!

Re: Retrieve full category tree?? Help needed

Posted: Thu Feb 22, 2018 7:07 am
by straightlight
No OC version posted. See this extension: https://www.opencart.com/index.php?rout ... n_id=27907

Re: Retrieve full category tree?? Help needed

Posted: Thu Feb 22, 2018 7:34 am
by pablormago
straightlight wrote:
Thu Feb 22, 2018 7:07 am
No OC version posted. See this extension: https://www.opencart.com/index.php?rout ... n_id=27907
Its 2.3.0.2. Thanks for your answer, but i need to do it myself, as part of the mod im working on...

My main need its to retrieve the full category tree from the database.

Re: Retrieve full category tree?? Help needed

Posted: Fri Feb 23, 2018 6:20 pm
by pablormago
Done!! Here is an example http://laclonadora.com/prueba11.php

The thing now is to translate it to opencart code.

Re: Retrieve full category tree?? Help needed

Posted: Fri Feb 23, 2018 8:05 pm
by straightlight
This dropdown only demonstrates a maximum of 1 sub-categories which Opencart can already demonstrate ...

Re: Retrieve full category tree?? Help needed

Posted: Wed Feb 28, 2018 8:21 pm
by pablormago
You can try now.