Jump to content

Category Tree Parent and Children Elements of Selected Element


beginner1

Recommended Posts

Hi everyone I have a question. I am making a module in which a button will be shown to a product of selected category by the user. My question is how can I get the parent and children elements of the selected item. For e.g in the category tree image that I have provided if the user select Top how will I know if this is for women or men? The same goes for shirts. Both men and women can have shirts. 

Screenshot_7.png

Link to comment
Share on other sites

The CategoryController has a method to return the current category object. This object has an id_parent property and an array of sub-categories. I don't remember exactly how it works, but you should have a look at the module ps_treeview. By looking at the code, you should find your way.

Link to comment
Share on other sites

  • 3 weeks later...
On 12/6/2017 at 11:45 PM, Pierre_d said:

The CategoryController has a method to return the current category object. This object has an id_parent property and an array of sub-categories. I don't remember exactly how it works, but you should have a look at the module ps_treeview. By looking at the code, you should find your way.

Okay thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...