beginner1 Posted December 4, 2017 Share Posted December 4, 2017 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. Link to comment Share on other sites More sharing options...
Pierre_d Posted December 6, 2017 Share Posted December 6, 2017 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 More sharing options...
beginner1 Posted December 23, 2017 Author Share Posted December 23, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now