Jump to content

in Detail product backoffice, i want to reduce the category tree


fde60

Recommended Posts

hi,

Per default, in PS 1.7, in detail product backoffice, the category tree is expand ! I want to reduce it on the start.

in file @Product/ProductPage/Forms/form_categories.html.twig

<div class="categories-tree js-categories-tree">

  <fieldset class="form-group">

    <div class="ui-widget">

      <div class="search search-with-icon">

        <input type="text" id="ps-select-product-category" class="form-control autocomplete search mb-1" placeholder="{{ 'Search categories'|trans({}, 'Admin.Catalog.Help') }}">

      </div>

      <label class="form-control-label text-uppercase">{{ 'Associated categories'|trans({}, 'Admin.Catalog.Feature') }}</label>

      {{ include('@PrestaShop/Admin/Category/categories.html.twig', {'categories': categories }) }}

      {{ form_errors(form.id_category_default) }}

      {{ form_widget(form.id_category_default) }}

      <div class="categories-tree-actions js-categories-tree-actions">

        <span class="form-control-label" id="categories-tree-expand"><i class="material-icons">expand_more</i>{{ "Expand"|trans({}, 'Admin.Actions') }}</span>

        <span class="form-control-label" id="categories-tree-reduce"><i class="material-icons">expand_less</i>{{ "Collapse"|trans({}, 'Admin.Actions') }}</span>

      </div>

      {{ form_widget(form.categories, {'defaultCategory': true}) }} {# see bootstrap_4_layout.html.twig #}

    </div>

  </fieldset>

  {{ form_errors(form.categories) }}

  {{ form_widget(form.categories) }} {# see bootstrap_4_layout.html.twig #}

</div>

where is the parameter to "say" it?

Thank you

Link to comment
Share on other sites

  • 5 months later...

FTP: /public_html/src/PrestaShopBundle/Resources/views/Admin/Product/ProductPage/product.html.twig

Add this script at line 329:

$(document).ready(function($) {
          if ($('#categories-tree-reduce').length) {
              $('#categories-tree-reduce').trigger('click');
          }

      });

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