2
votes

I'm working on a prestashop site and I would like to change the title of the Category module from "Categories" to be the Parent Category's Name. So, if you are on a subcategory page the Category Module would have the title of the Parent Category and if you are on the Parent Category page the title would be that Category Name. Any thoughts? Thanks!

2

2 Answers

3
votes
 $category = new Category ($productcsv['id_category_default'],Context::getContext()->language->id);

 $category->name;
0
votes

I don't know the category module but here is how this should work:

Somewhere the categories are retrieved. In a category object you will find a property storing the id of the parent category (I can't remember if it is id_parent or id_parent_category but this will be easy to find out). With this id, create a new category object and you will have the name.