Jump to content

Backoffice Product Categories Collapsed by default


Geoc112

Recommended Posts

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

ps18.png.04e98800e8e32ca672ac92059308d696.png

There is neccessary to clear cache (namely var/cache/prod/twig) (or var/cache/dev/twig)

  • Like 1
Link to comment
Share on other sites

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

ps18.png.04e98800e8e32ca672ac92059308d696.png

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

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...