Geoc112 Posted August 5, 2020 Share Posted August 5, 2020 How can i make it so the category tree in the product edit be collapsed by default instead of extended ? I've attached and image of the block i am refering to. Link to comment Share on other sites More sharing options...
Geoc112 Posted August 7, 2020 Author Share Posted August 7, 2020 Anyone have any idea ? Link to comment Share on other sites More sharing options...
EvaF Posted August 7, 2020 Share Posted August 7, 2020 I would do it by the simplest way: when the product page is ready, simulate click on "Collapse" $(document).ready(function($){ if ($('#categories-tree-reduce').length) { $('#categories-tree-reduce').trigger('click'); } }); Now there is question where to place this piece of javascript code: maybe somene knows about a better place - i have decided for src/PrestaShopBundle/Resources/views/Admin/Product/ProductPage/product.html.twig There is neccessary to clear cache (namely var/cache/prod/twig) (or var/cache/dev/twig) 1 Link to comment Share on other sites More sharing options...
Geoc112 Posted August 7, 2020 Author Share Posted August 7, 2020 25 minutes ago, EvaF said: I would do it by the simplest way: when the product page is ready, simulate click on "Collapse" $(document).ready(function($){ if ($('#categories-tree-reduce').length) { $('#categories-tree-reduce').trigger('click'); } }); Now there is question where to place this piece of javascript code: maybe somene knows about a better place - i have decided for src/PrestaShopBundle/Resources/views/Admin/Product/ProductPage/product.html.twig There is neccessary to clear cache (namely var/cache/prod/twig) (or var/cache/dev/twig) Thanks a lot! 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