asdasd2 Posted December 20, 2019 Share Posted December 20, 2019 (edited) Hey. What's the best way to eliminate a category and all its subcontent (subcategories, subitems, other) from the frontend completely? Basically, it should only be visible in the backend and there should be no trace of it in the frontend whatsoever. It should only be visible (and editable) in the backend. Neither disabling a category or disconnecting it from all user groups did that. If it's not possible to do via the backend, I will try to hardcode a skip-this-category clause directly in code, but would rather avoid doing that. A permanently disabled "maintenance branch" of the category tree kind of feature would also do the trick. Thank you. Edited December 20, 2019 by asdasd2 (see edit history) Link to comment Share on other sites More sharing options...
selectshop.at Posted December 20, 2019 Share Posted December 20, 2019 Of course you can maintain shop and shop non-active categories for product administration for ex. (for to import all products first to non active category and then from there work-out your products). You simply deactivate the category. I presume you are using PS 1.7. if not it's the same, tick the green check. Categories not active will have an red X: 1 hour ago, asdasd2 said: Neither disabling a category or disconnecting it from all user groups did that. Why not ? It should do that what you want. You need to add the products added to this category to another main category, otherwise you will have problems with the disabled category. Main category should be always an active category. Link to comment Share on other sites More sharing options...
joseantgv Posted December 20, 2019 Share Posted December 20, 2019 hace 1 hora, selectshop.at dijo: Of course you can maintain shop and shop non-active categories for product administration for ex. (for to import all products first to non active category and then from there work-out your products). You simply deactivate the category. I presume you are using PS 1.7. if not it's the same, tick the green check. Categories not active will have an red X: Why not ? It should do that what you want. You need to add the products added to this category to another main category, otherwise you will have problems with the disabled category. Main category should be always an active category. I suppose that subcategories are displayed if you don't disable them one by one... Link to comment Share on other sites More sharing options...
asdasd2 Posted December 21, 2019 Author Share Posted December 21, 2019 3 hours ago, joseantgv said: I suppose that subcategories are displayed if you don't disable them one by one... Yes, that's the point. I came up with a workaround: register_shutdown_function in which I make an update query in which I manually disable all categories, content etc. from the branch in question after every request to the backend. Still it's hardly elegant, so I hope there is a better solution. Link to comment Share on other sites More sharing options...
joseantgv Posted December 21, 2019 Share Posted December 21, 2019 If you want to follow PrestaShop architecture, you could use actionObjectCategoryUpdateAfter hook. 1 Link to comment Share on other sites More sharing options...
selectshop.at Posted December 21, 2019 Share Posted December 21, 2019 14 hours ago, joseantgv said: I suppose that subcategories are displayed if you don't disable them one by one... This should not be, because they are a parent of one main category. I didn't checked it for PS 1.7. but in PS 1.6. it works, if you disable the main category, so no parent category of this main category are shown in front-office as well. I was using this system for over 10 years with administrative and shop non-active categories for to maintain product imports and exports. Besides the categories which are shop active. 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