{#**
 * 2007-2017 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2017 PrestaShop SA
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *#}
{% extends 'PrestaShopBundle:Admin:layout.html.twig' %}

{% block content %}

  <form name="form" id="form" method="post" class="form-horizontal product-page row" novalidate="novalidate">

    {% if not editable %} <fieldset disabled id="field-disabled"> {% endif %}
    {# PRODUCT HEADER #}
    <div class="product-header">
      {% if is_multishop_context %}
        <div class="col-md-12">
          <div class="alert alert-warning" role="alert">
            <i class="material-icons">info_outline</i><p class="alert-text">{{ 'You are in a multistore context: any modification will impact all your shops, or each shop of the active group.'|trans({}, 'Admin.Catalog.Notification') }}</p>
          </div>
        </div>
      {% endif %}

      <div class="col-md-10 col-md-offset-1">
        <div class="row">
          <div class="col-md-7 big-input {{ 'PS_FORCE_FRIENDLY_PRODUCT'|configuration == 1 ? 'friendly-url-force-update' : '' }}" id="form_step1_names">
            {{ form_widget(form.step1.name) }}
          </div>
          <div class="col-md-2 form_step1_type_product">
            {{ form_widget(form.step1.type_product) }}
            <span class="help-box pull-xs-right" data-toggle="popover"
              data-content="{{ "Is the product a pack (a combination of at least two existing products), a virtual product (downloadable file, service, etc.), or simply a standard, physical product?"|trans({}, 'Admin.Catalog.Help') }}"></span>
          </div>
          <div class="col-md-1 form_switch_language">
            <div class="{{ languages|length == 1 ? 'hide' : '' }}">
              <select id="form_switch_language" class="form-control" data-toggle="select2">
                {% for language in languages %}
                  <option value="{{ language.iso_code }}" {% if default_language_iso == language.iso_code %}selected="selected"{% endif %}>{{ language.iso_code }}</option>
                {% endfor %}
              </select>
            </div>
          </div>
          <div class="toolbar col-lg-2 text-md-right">
            <a class="toolbar-button btn-sales" href="{{ stats_link }}" target="_blank" title="{{ 'Sales'|trans({}, 'Admin.Global') }}"
               id="product_form_go_to_sales">
              <i class="material-icons">assessment</i>
              <span class="title">{{ 'Sales'|trans({}, 'Admin.Global') }}</span>
            </a>

            <a
              class="toolbar-button btn-quicknav btn-sidebar"
              href="#"
              title="{{ 'Quick navigation'|trans({}, 'Admin.Global') }}"
              data-toggle="sidebar"
              data-target="#right-sidebar"
              data-url="{{ path('admin_product_list', {limit: 'last', offset: 'last', view: 'quicknav'}) }}"
              id="product_form_open_quicknav"
            >
              <i class="material-icons">list</i>
              <span class="title">{{ 'Product list'|trans({}, 'Admin.Catalog.Feature') }}</span>
            </a>

            <a class="toolbar-button btn-help btn-sidebar" href="#"
               title="{{ 'Help'|trans({}, 'Admin.Global') }}"
               data-toggle="sidebar"
               data-target="#right-sidebar"
               data-url="{{ help_link }}"
               id="product_form_open_help"
            >
              <i class="material-icons">help</i>
              <span class="title">{{ 'Help'|trans({}, 'Admin.Global') }}</span>
            </a>
          </div>
        </div>
        <div class="row">
          <div class="col-lg-12">
            {{ form_errors(form.step1.name) }}
            {{ form_errors(form.step1.type_product) }}
          </div>
        </div>
      </div>
      <div class="clearfix"></div>
    </div>

    <div class="col-md-10 col-md-offset-1">
      <div id="form_bubbling_errors">
        {{ form_errors(form) }}
      </div>
    </div>

    {# FORM TABS CONTAINER #}
    <div id="form-loading" class="col-md-10 col-md-offset-1">
      <div class="tabs js-tabs">
        <div class="arrow js-arrow left-arrow pull-left">
          <i class="material-icons hide">chevron_left</i>
        </div>
        <ul class="nav nav-tabs js-nav-tabs" id="form-nav" role="tablist">
          <li id="tab_step1" class="nav-item"><a href="#step1" role="tab" data-toggle="tab" class="nav-link active">{{ 'Basic settings'|trans({}, 'Admin.Catalog.Feature') }}</a></li>
          <li id="tab_step3" class="nav-item"><a href="#step3" role="tab" data-toggle="tab" class="nav-link">{{ 'Quantities'|trans({}, 'Admin.Catalog.Feature') }}</a></li>
          <li id="tab_step4" class="nav-item"><a href="#step4" role="tab" data-toggle="tab" class="nav-link">{{ 'Shipping'|trans({}, 'Admin.Catalog.Feature') }}</a></li>
          <li id="tab_step2" class="nav-item"><a href="#step2" role="tab" data-toggle="tab" class="nav-link">{{ 'Pricing'|trans({}, 'Admin.Catalog.Feature') }}</a></li>
          <li id="tab_step5" class="nav-item"><a href="#step5" role="tab" data-toggle="tab" class="nav-link">{{ 'SEO'|trans({}, 'Admin.Catalog.Feature') }}</a></li>
          <li id="tab_step6" class="nav-item"><a href="#step6" role="tab" data-toggle="tab" class="nav-link">{{ 'Options'|trans({}, 'Admin.Global') }}</a></li>
          {% if hookcount('displayAdminProductsExtra') > 0 %}
            <li id="tab_hooks" class="nav-item"><a href="#hooks" role="tab" data-toggle="tab" class="nav-link">{{ 'Modules'|trans({}, 'Admin.Catalog.Feature') }}</a></li>
          {% endif %}
        </ul>
        <div class="arrow js-arrow right-arrow visible pull-right">
          <i class="material-icons hide">chevron_right</i>
        </div>
      </div>
      <div id="form_content" class="tab-content">

        {# STEP 1 #}
        <div role="tabpanel" class="form-contenttab tab-pane active" id="step1">
          <div class="row">
            <div class="col-md-12">
              <div class="container-fluid">
                <div class="row">

                  {# LEFT #}
                  <div class="col-md-9 left-column">

                    <div id="js_form_step1_inputPackItems">
                      {{ form_errors(form.step1.inputPackItems) }}
                      {{ form_widget(form.step1.inputPackItems) }}
                    </div>

                    <div id="product-images-container" class="m-b-2">
                      <div id="product-images-dropzone" class="panel dropzone ui-sortable col-md-12"
                           url-upload="{{ path('admin_product_image_upload', {'idProduct': id_product}) }}"
                           url-position="{{ path('admin_product_image_positions') }}"
                           data-max-size="{{ 'PS_ATTACHMENT_MAXIMUM_SIZE'|configuration }}"
                      >
                        <div id="product-images-dropzone-error" class="text-danger"></div>
                        <div class="dz-default dz-message openfilemanager">
                            <i class="material-icons">add_a_photo</i><br/>
                            {{js_translatable['Drop images here']}}<br/>
                            <a>{{js_translatable['or select files']}}</a><br/>
                            <small>
                                {{js_translatable['files recommandations']}}<br/>
                                {{js_translatable['files recommandations2']}}
                            </small>
                        </div>
                        {% if form.step1.vars.value.images is defined %}
                            {% if editable %}
                                <div class="dz-preview disabled openfilemanager">
                                    <div><span>+</span></div>
                                </div>
                            {% endif %}
                          {% for image in form.step1.vars.value.images %}
                            <div class="dz-preview dz-processing dz-image-preview dz-complete ui-sortable-handle"
                                 data-id="{{ image.id }}"
                                 url-delete="{{ path('admin_product_image_delete', {'idImage': image.id}) }}"
                                 url-update="{{ path('admin_product_image_form', {'idImage': image.id}) }}"
                            >
                              <div class="dz-image bg" style="background-image: url('{{ image.base_image_url }}-home_default.{{ image.format }}');"></div>
                              <div class="dz-details">
                                <div class="dz-size"><span data-dz-size=""></span></div>
                                <div class="dz-filename"><span data-dz-name=""></span></div>
                              </div>
                              <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress="" style="width: 100%;"></span></div>
                              <div class="dz-error-message"><span data-dz-errormessage=""></span></div>
                              <div class="dz-success-mark"></div>
                              <div class="dz-error-mark"></div>
                              {% if image.cover %}
                                <div class="iscover">{{ 'Cover'|trans({}, 'Admin.Catalog.Feature') }}</div>
                              {% endif %}
                            </div>
                          {% endfor %}
                        {% endif %}
                      </div>
                      <div id="product-images-form-container" class="col-md-4">
                        <div id="product-images-form"></div>
                      </div>
                      <div class="dropzone-expander text-xs-center col-md-12">
                        <span class="expand">{{ 'View all images'|trans({}, 'Admin.Catalog.Feature') }}</span>
                        <span class="compress">{{ 'View less'|trans({}, 'Admin.Catalog.Feature') }}</span>
                      </div>

                    </div>

                    <ul class="nav nav-tabs bordered">
                      <li id="tab_description_short" class="nav-item"><a href="#description_short" data-toggle="tab" class="nav-link description-tab active">{{ 'Summary'|trans({}, 'Admin.Catalog.Feature') }}</a></li>
                      <li id="tab_description" class="nav-item"><a href="#description" data-toggle="tab" class="nav-link description-tab">{{ 'Description'|trans({}, 'Admin.Global') }}</a></li>
                    </ul>

                    <div class="tab-content bordered">
                      <div class="tab-pane panel panel-default active" id="description_short">
                        {{ form_widget(form.step1.description_short) }}
                      </div>
                      <div class="tab-pane panel panel-default " id="description">
                        {{ form_widget(form.step1.description) }}
                      </div>
                    </div>

                    <div id="features" class="m-b-1 m-t-1">
                      <div id="features-content" class="content {{ form.step1.features|length == 0 ? 'hide':'' }}">
                        <h2>{{ 'Features'|trans({}, 'Admin.Catalog.Feature') }}</h2>
                        {{ form_errors(form.step1.features) }}
                        <div
                          class="feature-collection nostyle"
                          data-prototype="{% filter escape %}
                            {{ include('PrestaShopBundle:Admin/Product/Include:form_feature.html.twig', { 'form': form.step1.features.vars.prototype }) }}
                          {% endfilter %}"
                        >
                          {% for feature in form.step1.features %}
                            {{ include('PrestaShopBundle:Admin/Product/Include:form_feature.html.twig', { 'form': feature }) }}
                          {% endfor %}
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-md-4">
                          <button type="button" class="btn btn-primary-outline sensitive add" id="add_feature_button"><i class="material-icons">add_circle</i> {{ 'Add a feature'|trans({}, 'Admin.Catalog.Feature') }}</button>
                        </div>
                      </div>
                    </div>

                    <div id="manufacturer" class="m-b-1">
                      {{ include('PrestaShopBundle:Admin/Product/Include:form_manufacturer.html.twig', { 'form':form.step1.id_manufacturer }) }}
                    </div>

                    <div id="related-product" class="m-b-1">
                      {{ include('PrestaShopBundle:Admin/Product/Include:form_related_products.html.twig', { 'form':form.step1.related_products }) }}
                    </div>

                  </div>

                  {# RIGHT #}
                  <div class="col-md-3 right-column">

                      <div class="row">
                        <div class="col-md-12">

                          {% if is_combination_active %}
                            <div class="form-group" id="show_variations_selector">
                              <h2>
                                {{ "Combinations"|trans({}, 'Admin.Catalog.Feature') }}
                                <span class="help-box" data-toggle="popover"
                                  data-content="{{ "Combinations are the different variations of a product, with attributes like its size, weight or color taking different values. Does your product require combinations?"|trans({}, 'Admin.Catalog.Help') }}" ></span>
                              </h2>
                              <div class="radio">
                                <label>
                                  <input type="radio" name="show_variations" value="0" {% if not has_combinations %}checked="checked"{% endif %}>
                                  {{ "Simple product"|trans({}, 'Admin.Catalog.Feature') }}
                                </label>
                              </div>
                              <div class="radio">
                                <label>
                                  <input type="radio" name="show_variations" value="1" {% if has_combinations %}checked="checked"{% endif %}>
                                  {{ "Product with combinations"|trans({}, 'Admin.Catalog.Feature') }}
                                </label>
                                <div id="product_type_combinations_shortcut">
                                  <span class="small font-secondary">
                                    {# First tag [1][/1] is for a HTML link. Second tag [2] is an icon (no closing tag needed). #}
                                    {{ "Advanced settings in [1][2]Combinations[/1]"|trans({}, 'Admin.Catalog.Help')|replace({'[1]': '<a href="#tab-step3" onclick="$(\'a[href=\\\'#step3\\\']\').tab(\'show\');" class="btn sensitive p-x-0">', '[/1]': '</a>', '[2]': '<i class="material-icons">open_in_new</i>'})|raw }}
                                  </span>
                                </div>
                              </div>
                            </div>
                          {% endif %}

                          <div class="form-group">
                            <h2>
                              {{ "Reference"|trans({}, 'Admin.Catalog.Feature') }}
                              <span class="help-box" data-toggle="popover"
                                data-content="{{ "Your reference code for this product. Allowed special characters: .-_#\."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                            </h2>
                            {{ form_errors(form.step6.reference) }}
                            <div class="row">
                              <div class="col-xl-12 col-lg-12" id="product_reference_field">
                                  {{ form_widget(form.step6.reference) }}
                              </div>
                            </div>
                          </div>

                          {% if 'PS_STOCK_MANAGEMENT'|configuration %}
                            <div class="form-group" id="product_qty_0_shortcut_div">
                              <h2>
                                {{ "Quantity"|trans({}, 'Admin.Catalog.Feature') }}
                                <span class="help-box" data-toggle="popover"
                                  data-content="{{ "How many products should be available for sale?"|trans({}, 'Admin.Catalog.Help') }}" ></span>
                              </h2>
                              {{ form_errors(form.step1.qty_0_shortcut) }}
                              <div class="row">
                                <div class="col-xl-6 col-lg-12">
                                  {{ form_widget(form.step1.qty_0_shortcut) }}
                                </div>
                              </div>
                              <span class="small font-secondary">
                                {# First tag [1][/1] is for a HTML link. Second tag [2] is an icon (no closing tag needed). #}
                                {{ "Advanced settings in [1][2]Quantities[/1]"|trans({}, 'Admin.Catalog.Help')|replace({'[1]': '<a href="#tab-step3" onclick="$(\'a[href=\\\'#step3\\\']\').tab(\'show\');" class="btn sensitive p-x-0">', '[/1]': '</a>', '[2]': '<i class="material-icons">open_in_new</i>'})|raw }}
                              </span>
                            </div>
                          {% endif %}

                          <div class="form-group">
                            <h2>
                              {{ "Price"|trans({}, 'Admin.Global') }}
                              <span class="help-box" data-toggle="popover"
                                data-content="{{ "This is the retail price at which you intend to sell this product to your customers. The tax included price will change according to the tax rule you select."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                            </h2>
                            <div class="row">
                              <div class="col-md-6">
                                <label class="form-control-label">{{ "Tax excluded"|trans({}, 'Admin.Catalog.Feature') }}</label>
                                {{ form_widget(form.step1.price_shortcut) }}
                                {{ form_errors(form.step1.price_shortcut) }}
                              </div>
                              <div class="col-md-6 col-offset-md-1">
                                <label class="form-control-label">{{ "Tax included"|trans({}, 'Admin.Catalog.Feature') }}</label>
                                {{ form_widget(form.step1.price_ttc_shortcut) }}
                                {{ form_errors(form.step1.price_ttc_shortcut) }}
                              </div>
                              <div class="col-md-12 m-t-1">
                                <label class="form-control-label">{{ "Tax rule"|trans({}, 'Admin.Catalog.Feature') }}</label>
                                {{ render(controller('PrestaShopBundle:Admin/Product:renderField', {'productId': id_product, 'step': 'step2', 'fieldName': 'id_tax_rules_group' })) }}
                              </div>
                              <div class="col-md-12">
                                <span class="small font-secondary">
                                  {# First tag [1][/1] is for a HTML link. Second tag [2] is an icon (no closing tag needed). #}
                                  {{ "Advanced settings in [1][2]Pricing[/1]"|trans({}, 'Admin.Catalog.Help')|replace({'[1]': '<a href="#tab-step2" onclick="$(\'a[href=\\\'#step2\\\']\').tab(\'show\');" class="btn sensitive p-x-0">', '[/1]': '</a>', '[2]': '<i class="material-icons">open_in_new</i>'})|raw }}
                                </span>
                              </div>
                            </div>
                            <div class="row hide">
                              <div class="col-md-12">
                                <label>{{ "Tax rule"|trans({}, 'Admin.Catalog.Feature') }}</label>
                              </div>
                              <div class="clearfix"></div>
                              <div class="col-md-11" id="tax_rule_shortcut">
                              </div>
                              <a href="#" onclick="$(this).parent().hide()">&times;</a>
                            </div>
                          </div>

                          <div class="form-group">
                            {{ include('PrestaShopBundle:Admin/Product/Include:form-categories.html.twig', { 'form': form.step1, 'productId': id_product }) }}
                          </div>
                        </div>
                      </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

        {# STEP 2 #}
        <div role="tabpanel" class="form-contenttab tab-pane" id="step3">
          <div class="row">
            <div class="col-md-12">
              <div class="container-fluid">
                <div class="row">

                  <div class="col-md-12">

                    <div id="quantities" style="{% if has_combinations or form.step3.depends_on_stock.vars.value != "0" %}display: none;{% endif %}">
                      <h2>{{ 'Quantities'|trans({}, 'Admin.Catalog.Feature') }}</h2>
                      <fieldset class="form-group">
                        <div class="row">
                          {% if 'PS_STOCK_MANAGEMENT'|configuration %}
                            <div class="col-md-4">
                              <label class="form-control-label">{{ form.step3.qty_0.vars.label }}</label>
                              {{ form_errors(form.step3.qty_0) }}
                              {{ form_widget(form.step3.qty_0) }}
                            </div>
                          {% endif %}
                          <div class="col-md-4">
                            <label class="form-control-label">{{ form.step3.minimal_quantity.vars.label }}</label>
                            <span class="help-box" data-toggle="popover"
                                  data-content="{{ "The minimum quantity required to buy this product (set to 1 to disable this feature). E.g.: if set to 3, customers will be able to purchase the product only if they take at least 3 in quantity."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                            {{ form_errors(form.step3.minimal_quantity) }}
                            {{ form_widget(form.step3.minimal_quantity) }}
                          </div>
                        </div>
                      </fieldset>
                    </div>

                    <div id="virtual_product" data-action="{{ path('admin_product_virtual_save_action', { 'idProduct': 1 }) }}" data-action-remove="{{ path('admin_product_virtual_remove_action', {'idProduct': 1}) }}">

                      <div class="row">
                        <div class="col-md-4">
                          <h2>{{ form.step3.virtual_product.vars.label }}</h2>
                        </div>
                        <div class="col-md-8">
                          <fieldset class="form-group">
                            {{ form_widget(form.step3.virtual_product.is_virtual_file) }}
                          </fieldset>
                        </div>
                      </div>

                      <div id="virtual_product_content" class="row col-md-8">
                        {{ form_errors(form.step3.virtual_product) }}
                        <div class="col-md-12">
                          <fieldset class="form-group">
                            <label class="form-control-label">{{ form.step3.virtual_product.file.vars.label }}</label>
                            <span class="help-box" data-toggle="popover"
                                  data-content="{{ "Upload a file from your computer (%maxUploadSize% max.)"|trans({'%maxUploadSize%': max_upload_size}, 'Admin.Catalog.Help') }}" ></span>
                            <div id="form_step3_virtual_product_file_input" class="{{ form.step3.virtual_product.vars.value.filename is defined ? 'hide' : 'show' }}">
                              {{ form_widget(form.step3.virtual_product.file) }}
                            </div>
                            <div id="form_step3_virtual_product_file_details" class="{{ form.step3.virtual_product.vars.value.filename is defined ? 'show' : 'hide' }}">
                              <a href="{{ form.step3.virtual_product.vars.value.file_download_link is defined ? form.step3.virtual_product.vars.value.file_download_link : '' }}" class="btn btn-default btn-sm download">{{ 'Download file'|trans({}, 'Admin.Actions') }}</a>
                              <a href="{{ path('admin_product_virtual_remove_file_action', {'idProduct': id_product}) }}" class="btn btn-danger btn-sm delete">{{ 'Delete this file'|trans({}, 'Admin.Actions') }}</a>
                            </div>
                          </fieldset>
                        </div>
                        <div class="col-md-6">
                          <fieldset class="form-group">
                            <label class="form-control-label">{{ form.step3.virtual_product.name.vars.label }}</label>
                            <span class="help-box" data-toggle="popover"
                                  data-content="{{ "The full filename with its extension (e.g. Book.pdf)"|trans({}, 'Admin.Catalog.Help') }}" ></span>
                            {{ form_errors(form.step3.virtual_product.name) }}
                            {{ form_widget(form.step3.virtual_product.name) }}
                          </fieldset>
                        </div>
                        <div class="col-md-6">
                          <fieldset class="form-group">
                            <label class="form-control-label">{{ form.step3.virtual_product.nb_downloadable.vars.label }}</label>
                            <span class="help-box" data-toggle="popover"
                                  data-content="{{ "Number of downloads allowed per customer. Set to 0 for unlimited downloads."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                            {{ form_errors(form.step3.virtual_product.nb_downloadable) }}
                            {{ form_widget(form.step3.virtual_product.nb_downloadable) }}
                          </fieldset>
                        </div>
                        <div class="col-md-6">
                          <fieldset class="form-group">
                            <label class="form-control-label">{{ form.step3.virtual_product.expiration_date.vars.label }}</label>
                            <span class="help-box" data-toggle="popover"
                                  data-content="{{ "If set, the file will not be downloadable after this date. Leave blank if you do not wish to attach an expiration date."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                            {{ form_errors(form.step3.virtual_product.expiration_date) }}
                            {{ form_widget(form.step3.virtual_product.expiration_date) }}
                          </fieldset>
                        </div>
                        <div class="col-md-6">
                          <fieldset class="form-group">
                            <label class="form-control-label">{{ form.step3.virtual_product.nb_days.vars.label }}</label>
                            <span class="help-box" data-toggle="popover"
                                  data-content="{{ "Number of days this file can be accessed by customers. Set to zero for unlimited access."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                            {{ form_errors(form.step3.virtual_product.nb_days) }}
                            {{ form_widget(form.step3.virtual_product.nb_days) }}
                          </fieldset>
                        </div>
                        <div class="col-md-12">
                          {{ form_widget(form.step3.virtual_product.save) }}
                        </div>
                      </div>
                    </div>

                    {% if asm_globally_activated and form.step1.type_product.vars.value != "2" %}
                      <div class="form-group" id="asm_quantity_management">
                        <label class="col-sm-2 control-label" for="form_step3_advanced_stock_management"></label>
                        <div class="col-sm-10">
                          {{ form_errors(form.step3.advanced_stock_management) }}
                          {{ form_widget(form.step3.advanced_stock_management) }}
                          {% if form.step1.type_product.vars.value == "1" %}
                            {{ 'When enabling advanced stock management for a pack, please make sure it is also enabled for its product(s) – if you choose to decrement product quantities.'|trans({}, 'Admin.Catalog.Notification') }}
                          {% endif %}
                        </div>
                      </div>
                      <div class="form-group" id="depends_on_stock_div" style="{% if not(form.step3.advanced_stock_management.vars.checked) %}display: none;{% endif %}">
                        <label class="col-sm-2 control-label" for="form_step3_depends_on_stock"></label>
                        <div class="col-sm-10">
                          {{ form_errors(form.step3.depends_on_stock) }}
                          {{ form_widget(form.step3.depends_on_stock) }}
                        </div>
                      </div>
                    {% endif %}
                    {% if 'PS_STOCK_MANAGEMENT'|configuration %}
                      <div id="pack_stock_type">
                        <h2>{{ form.step3.pack_stock_type.vars.label }}</h2>
                        <div class="row col-md-4">
                          <fieldset class="form-group">
                            {{ form_errors(form.step3.pack_stock_type) }}
                            {{ form_widget(form.step3.pack_stock_type) }}
                          </fieldset>
                        </div>
                      </div>
                    {% endif %}
                    {{ include('PrestaShopBundle:Admin/Product/Include:form_combinations.html.twig', {'form': form.step3, 'form_combination_bulk': formCombinations}) }}

                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

        {# STEP 3 #}
        <div role="tabpanel" class="form-contenttab tab-pane" id="step4">
          <div class="row">
            <div class="col-md-12">
              <div class="container-fluid">
                <div class="row">
                  {{ include('PrestaShopBundle:Admin/Product/Include:form_shipping.html.twig', {
                    'form' : form.step4,
                    'asm_globally_activated': asm_globally_activated,
                    'isNotVirtual': form.step1.type_product.vars.value != "2",
                    'isChecked': form.step3.advanced_stock_management.vars.checked,
                    'warehouses': warehouses
                  }) }}
                </div>
              </div>
            </div>
          </div>
        </div>

        {# STEP 4 #}
        <div role="tabpanel" class="form-contenttab tab-pane" id="step2">
          <div class="row">
            <div class="col-md-12">
              <div class="container-fluid">
                <div class="row">

                  <div class="col-md-12">
                    <h2>{{ 'Retail price'|trans({}, 'Admin.Catalog.Feature') }}
                      <span class="help-box" data-toggle="popover"
                        data-content="{{ "This is the price at which you intend to sell this product to your customers. The tax included price will change according to the tax rule you select."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                    </h2>
                  </div>

                  <div class="col-md-12 form-group">
                    <div class="row">

                      <div class="col-xl-2 col-lg-3">
                        <label class="form-control-label">{{ form.step2.price.vars.label }}</label>
                        {{ form_errors(form.step2.price) }}
                        {{ form_widget(form.step2.price) }}
                      </div>
                      <div class="col-xl-2 col-lg-3">
                        <label class="form-control-label">{{ form.step2.price_ttc.vars.label }}</label>
                        {{ form_errors(form.step2.price_ttc) }}
                        {{ form_widget(form.step2.price_ttc) }}
                      </div>

                      <div class="col-xl-4 col-lg-6 col-xl-offset-1 col-lg-offset-0">
                        <label class="form-control-label">
                          {{ form.step2.unit_price.vars.label }}
                          <span class="help-box" data-toggle="popover"
                            data-content="{{ "Some products can be purchased by unit (per bottle, per pound, etc.),  and this is the price for one unit. For instance, if you’re selling fabrics, it would be the price per meter."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                        </label>
                        <div class="row">
                          <div class="col-md-6">
                            {{ form_errors(form.step2.unit_price) }}
                            {{ form_widget(form.step2.unit_price) }}
                          </div>
                          <div class="col-md-6">
                            {{ form_errors(form.step2.unity) }}
                            {{ form_widget(form.step2.unity) }}
                          </div>
                        </div>
                      </div>
                      <div class="col-md-2 col-md-offset-1 {% if 'PS_USE_ECOTAX'|configuration != 1 %}hide{% endif %}">
                        <label class="form-control-label">{{ form.step2.ecotax.vars.label }}</label>
                        {{ form_errors(form.step2.ecotax) }}
                        {{ form_widget(form.step2.ecotax) }}
                      </div>
                    </div>
                  </div>

                  <div class="col-md-12">
                    <div class="row form-group">
                      <div class="col-md-4">
                        <label class="form-control-label">{{ form.step2.id_tax_rules_group.vars.label }}</label>
                        {{ form_errors(form.step2.id_tax_rules_group) }}
                        {{ form_widget(form.step2.id_tax_rules_group) }}
                      </div>
                      <div class="col-md-8">
                        <label class="form-control-label">&nbsp;</label>
                        <a class="form-control-static external-link" href="{{ getAdminLink("AdminTaxes") }}">
                          <i class="material-icons">open_in_new</i> {{ 'Manage tax rules'|trans({}, 'Admin.Catalog.Feature') }}
                        </a>
                      </div>
                      <div class="col-md-12 p-t-1">
                        {{ form_widget(form.step2.on_sale) }}
                      </div>
                      <div class="col-md-12">
                        <div class="row">
                          <div class="col-xl-5 col-lg-12">
                            <div class="alert alert-info" role="alert">
                              <i class="material-icons">help</i>
                              <p class="alert-text">
                                {{ 'Final retail price: [1][2][/2] tax incl.[/1] / [3][/3] tax excl.'|trans({}, 'Admin.Catalog.Feature')|replace({ '[1]': '<strong>', '[/1]': '</strong>', '[2]': '<span id="final_retail_price_ti">', '[/2]': '</span>', '[3]': '<span id="final_retail_price_te">', '[/3]': '</span>', })|raw }}
                              </p>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="col-md-12">
                    <div class="row">
                      <div class="col-md-12">
                        <h2>
                          {{ 'Cost price'|trans({}, 'Admin.Catalog.Feature') }}
                          <span class="help-box" data-toggle="popover"
                            data-content="{{ "The cost price is the price you paid for the product. Do not include the tax. It should be lower than the retail price: the difference between the two will be your margin."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                        </h2>
                      </div>
                      <div class="col-xl-2 col-lg-3 form-group">
                        <label class="form-control-label">{{ form.step2.wholesale_price.vars.label|raw }}</label>
                        {{ form_errors(form.step2.wholesale_price) }}
                        {{ form_widget(form.step2.wholesale_price) }}
                      </div>
                    </div>
                  </div>

                  <div class="col-md-12">
                    <div class="row">
                      <div class="col-md-12">
                        <h2>
                          {{ 'Specific prices'|trans({}, 'Admin.Catalog.Feature') }}
                          <span class="help-box" data-toggle="popover"
                            data-content="{{ "You can set specific prices for customers belonging to different groups, different countries, etc."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                        </h2>
                      </div>
                      <div class="col-md-12">
                        <div id="specific-price" class="m-b-2">
                          <a class="btn btn-action m-b-2" data-toggle="collapse" href="#specific_price_form" aria-expanded="false">
                            <i class="material-icons">add_circle</i>
                            {{ 'Add a specific price'|trans({}, 'Admin.Catalog.Feature') }}
                          </a>
                          <table id="js-specific-price-list" class="table table-striped hide seo-table" data="{{ path('admin_specific_price_list', { 'idProduct': 1 }) }}" data-action-delete="{{ path('admin_delete_specific_price', { 'idSpecificPrice': 1 }) }}">
                            <thead>
                            <tr>
                              <th>{{ 'Rule'|trans({}, 'Admin.Catalog.Feature') }}</th>
                              <th>{{ 'Combination'|trans({}, 'Admin.Catalog.Feature') }}</th>
                              <th>{{ 'Currency'|trans({}, 'Admin.Global') }}</th>
                              <th>{{ 'Country'|trans({}, 'Admin.Global') }}</th>
                              <th>{{ 'Group'|trans({}, 'Admin.Global') }}</th>
                              <th>{{ 'Customer'|trans({}, 'Admin.Global') }}</th>
                              <th>{{ 'Fixed price'|trans({}, 'Admin.Catalog.Feature') }}</th>
                              <th>{{ 'Impact'|trans({}, 'Admin.Catalog.Feature') }}</th>
                              <th>{{ 'Period'|trans({}, 'Admin.Global') }}</th>
                              <th>{{ 'From'|trans({}, 'Admin.Catalog.Feature') }}</th>
                              <th></th>
                            </tr>
                            </thead>
                            <tbody></tbody>
                          </table>
                        </div>
                        <div class="collapse" id="specific_price_form" data-action="{{ path('admin_specific_price_add') }}">
                          {{ include('PrestaShopBundle:Admin:Product/Include/form-specific-price.html.twig', {'form': form.step2.specific_price, 'is_multishop_context': is_multishop_context}) }}
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="col-md-12">
                    <div class="row">
                      <div class="col-md-12">
                        <h2>
                          {{ 'Priority management'|trans({}, 'Admin.Catalog.Feature') }}
                          <span class="help-box" data-toggle="popover"
                            data-content="{{ "Sometimes one customer can fit into multiple price rules. Priorities allow you to define which rules apply first."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                        </h2>
                      </div>
                      <div class="col-md-3">
                        <fieldset class="form-group">
                          <label>{{ 'Priorities'|trans({}, 'Admin.Catalog.Feature') }}</label>
                          {{ form_errors(form.step2.specificPricePriority_0) }}
                          {{ form_widget(form.step2.specificPricePriority_0) }}
                        </fieldset>
                      </div>
                      <div class="col-md-3">
                        <fieldset class="form-group">
                          <label>&nbsp;</label>
                          {{ form_errors(form.step2.specificPricePriority_1) }}
                          {{ form_widget(form.step2.specificPricePriority_1) }}
                        </fieldset>
                      </div>
                      <div class="col-md-3">
                        <fieldset class="form-group">
                          <label>&nbsp;</label>
                          {{ form_errors(form.step2.specificPricePriority_2) }}
                          {{ form_widget(form.step2.specificPricePriority_2) }}
                        </fieldset>
                      </div>
                      <div class="col-md-3">
                        <fieldset class="form-group">
                          <label>&nbsp;</label>
                          {{ form_errors(form.step2.specificPricePriority_3) }}
                          {{ form_widget(form.step2.specificPricePriority_3) }}
                        </fieldset>
                      </div>
                      <div class="col-md-12">
                        {{ form_widget(form.step2.specificPricePriorityToAll) }}
                      </div>
                    </div>
                  </div>

                </div>
              </div>
            </div>
          </div>
        </div>

        {# STEP 5 #}
        <div role="tabpanel" class="form-contenttab tab-pane" id="step5">
          <div class="row">
            <div class="col-md-12">
              <div class="container-fluid">
                <div class="row">

                  {{ include('PrestaShopBundle:Admin/Product/Include:form_seo.html.twig', {'form' : form.step5}) }}

                </div>
              </div>
            </div>
          </div>
        </div>

        {# STEP 6 #}
        <div role="tabpanel" class="form-contenttab tab-pane" id="step6">
          <div class="row">
            <div class="col-md-12">
              <div class="container-fluid">
                <div class="row">

                  <div class="col-md-12">

                    <div class="row">
                      <div class="col-md-12">
                        <h2>{{ 'Visibility'|trans({}, 'Admin.Catalog.Feature') }}</h2>
                        <p class="subtitle">{{ 'Where do you want your product to appear?'|trans({}, 'Admin.Catalog.Feature') }}</p>
                      </div>
                    </div>

                    <div class="row">
                      <div class="col-md-4 form-group">
                        {{ form_errors(form.step6.visibility) }}
                        {{ form_widget(form.step6.visibility) }}
                      </div>
                    </div>

                    <div class="row">
                      <div class="col-md-7 form-group">
                          {{ form_errors(form.step6.display_options) }}
                          <div class="row">
                            <div class="col-md-4 js-available-for-order">
                              {{ form_widget(form.step6.display_options.available_for_order) }}
                            </div>
                            <div class="col-md-3 js-show-price">
                              {{ form_widget(form.step6.display_options.show_price) }}
                            </div>
                            <div class="col-md-5">
                              {{ form_widget(form.step6.display_options.online_only) }}
                            </div>
                          </div>
                      </div>
                    </div>
                    <div class="row form-group">
                      <div class="col-md-8">
                        <label class="form-control-label">{{ 'Tags'|trans({}, 'Admin.Catalog.Feature') }}</label>
                        {{ form_errors(form.step6.tags) }}
                        {{ form_widget(form.step6.tags) }}
                        <div class="alert alert-info alert-drop m-t-1" role="alert">
                          <i class="material-icons">help</i>
                          <p class="alert-text" data-title="{{ 'Read more'|trans({}, 'Admin.Actions')|raw }}">
                            {{ 'Tags are meant to help your customers find your products via the search bar.'|trans({}, 'Admin.Catalog.Help')|raw }}
                            <strong>{{ 'Read more'|trans({}, 'Admin.Actions')|raw }}</strong>
                          </p>
                        </div>
                        <div class="alert alert-info alert-down" role="alert">
                          <p class="alert-down-text">
                            {{ 'Choose terms and keywords that your customers will use to search for this product and make sure you are consistent with the tags you may have already used.'|trans({}, 'Admin.Catalog.Help')|raw }}<br>
                            {{ 'You can manage tag aliases in the [1]Search section[/1].'|trans({}, 'Admin.Catalog.Help')|
                              replace({
                                '[1]' : '<a href="'~ getAdminLink("AdminSearchConf") ~'" target="_blank">',
                                '[/1]' : '</a>'
                              })|raw
                            }}
                          </p>
                        </div>
                      </div>
                    </div>

                    <div class="row">
                      <div class="col-md-12">
                        <h2>{{ 'Condition & References'|trans({}, 'Admin.Catalog.Feature')|raw }}</h2>
                      </div>
                    </div>

                    <div class="row">
                      <fieldset class="col-md-4 form-group">
                        <label class="form-control-label">
                          {{ form.step6.condition.vars.label }}
                          <span class="help-box" data-toggle="popover"
                            data-content="{{ "Not all shops sell new products. This option enables you to indicate the condition of the product. It can be required on some marketplaces."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                        </label>
                        {{ form_errors(form.step6.condition) }}
                        {{ form_widget(form.step6.condition) }}
                      </fieldset>
                      <fieldset class="col-md-4 form-group">
                        <label class="form-control-label">&nbsp;</label>
                        {{ form_widget(form.step6.show_condition) }}
                      </fieldset>
                    </div>
                    <div class="row">
                      <fieldset class="col-md-4 form-group">
                        <label class="form-control-label">
                          {{ form.step6.isbn.vars.label }}
                          <span class="help-box" data-toggle="popover"
                            data-content="{{ "ISBN is used internationally to identify books and their various editions."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                        </label>
                        {{ form_errors(form.step6.isbn) }}
                        {{ form_widget(form.step6.isbn) }}
                      </fieldset>
                      <fieldset class="col-md-4 form-group">
                        <label class="form-control-label">
                          {{ form.step6.ean13.vars.label }}
                          <span class="help-box" data-toggle="popover"
                            data-content="{{ "This type of product code is specific to Europe and Japan, but is widely used internationally. It is a superset of the UPC code: all products marked with an EAN will be accepted in North America."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                        </label>
                        {{ form_errors(form.step6.ean13) }}
                        {{ form_widget(form.step6.ean13) }}
                      </fieldset>
                    </div>
                    <div class="row">
                      <fieldset class="col-md-4 form-group">
                        <label class="form-control-label">
                          {{ form.step6.upc.vars.label }}
                          <span class="help-box" data-toggle="popover"
                            data-content="{{ "This type of product code is widely used in the United States, Canada, the United Kingdom, Australia, New Zealand and in other countries."|trans({}, 'Admin.Catalog.Help') }}" ></span>
                        </label>
                        {{ form_errors(form.step6.upc) }}
                        {{ form_widget(form.step6.upc) }}
                      </fieldset>
                    </div>

                    <div class="row">
                      <div class="col-md-12">
                        <div id="custom_fields" class="m-b-2">
                          <h2>{{ form.step6.custom_fields.vars.label }}</h2>
                          <p class="subtitle">{{ 'Customers can personalize the product by entering some text or by providing custom image files.'|trans({}, 'Admin.Catalog.Feature') }}</p>
                          {{ form_errors(form.step6.custom_fields) }}
                          <ul class="customFieldCollection nostyle" data-prototype="
                                      {% filter escape %}
                                      {{ include('PrestaShopBundle:Admin/Product/Include:form_custom_fields.html.twig', { 'form': form.step6.custom_fields.vars.prototype }) }}
                                      {% endfilter %}">
                            {% for field in form.step6.custom_fields %}
                              <li>
                                {{ include('PrestaShopBundle:Admin/Product/Include:form_custom_fields.html.twig', { 'form': field }) }}
                              </li>
                            {% endfor %}
                          </ul>
                          <a href="#" class="btn btn-action add">
                            <i class="material-icons">add_circle</i>
                            {{ 'Add a customization field'|trans({}, 'Admin.Catalog.Feature') }}
                          </a>
                        </div>
                      </div>
                    </div>

                    <div class="row">
                      <div class="col-md-8">
                        <h2>{{ 'Attached files'|trans({}, 'Admin.Catalog.Feature') }}</h2>
                        <p class="subtitle">{{ 'Add files that customers can download directly on the product page (instructions, manual, recipe, etc.).'|trans({}, 'Admin.Catalog.Feature') }}</p>
                        {{ form_widget(form.step6.attachments) }}
                      </div>
                    </div>
                    <div class="row">
                      <div class="col-md-8">
                        <a
                          class="btn btn-action add m-b-1"
                          href="#collapsedForm"
                          data-toggle="collapse"
                          aria-expanded="false"
                          aria-controls="collapsedForm"
                        >
                          <i class="material-icons">add_circle</i>
                          {{ 'Attach a new file'|trans({}, 'Admin.Catalog.Feature') }}
                        </a>
                        <fieldset class="form-group collapse" id="collapsedForm">
                          {{ form_errors(form.step6.attachment_product) }}
                          <div id="form_step6_attachment_product" data-action="{{ form.step6.attachment_product.vars.attr['data-action'] }}">
                            <div class="form-group">{{ form_widget(form.step6.attachment_product.file) }}</div>
                            <div class="form-group">{{ form_widget(form.step6.attachment_product.name) }}</div>
                            <div class="form-group">{{ form_widget(form.step6.attachment_product.description) }}</div>
                            <div class="form-group">
                              {{ form_widget(form.step6.attachment_product.add) }}
                              {{ form_widget(form.step6.attachment_product.cancel) }}
                            </div>
                          </div>
                        </fieldset>
                      </div>
                    </div>

                    <div class="row">
                      <div class="col-md-8" id="supplier_collection">
                        {{ include('PrestaShopBundle:Admin:Product/Include/form-supplier-choice.html.twig', { 'form': form.step6 }) }}
                      </div>
                    </div>
                    <div class="row">
                      <div id="supplier_combination_collection" class="col-md-12" data-url="{{ path('admin_supplier_refresh_product_supplier_combination_form', { 'idProduct': 1, 'supplierIds': 1}) }}">
                        {{ include('PrestaShopBundle:Admin:Product/Include/form-supplier-combination.html.twig', { 'suppliers': form.step6.suppliers.vars.value, 'form': form.step6 }) }}
                      </div>
                    </div>

                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

        {# OTHER STEPS #}
        {% if hookcount('displayAdminProductsExtra') > 0 %}
          <div role="tabpanel" class="form-contenttab tab-pane" id="hooks">
            <div class="row">
              <div class="col-md-12">
                <div class="container-fluid">
                  <div class="row">

                    {# LEFT #}
                    <div class="col-md-12">
                      {% set hooks = renderhooksarray('displayAdminProductsExtra', { 'id_product': id_product }) %}

                      <div class="row module-selection" style="display: none;">
                        <div class="col-md-12 col-lg-7">
                          {% for module in hooks %}
                            <div class="module-render-container module-{{ module.attributes.name }}">
                              <div>
                                <img class="top-logo" src="{{ module.attributes.img }}" alt="{{ module.attributes.displayName }}">
                                <h2 class="text-ellipsis module-name-grid">
                                  {{ module.attributes.displayName }}
                                </h2>
                                <div class="text-ellipsis xsmall module-version">
                                  {{ module.attributes.version }} by {{ module.attributes.author }}
                                </div>
                              </div>
                              <div class="small no-padding">
                                {{ module.attributes.description }}
                              </div>
                            </div>
                          {% endfor %}
                        </div>
                        <div class="col-md-12 col-lg-5">
                          <h2>{{ 'Module to configure'|trans({}, 'Admin.Catalog.Feature') }}</h2>
                          <select class="modules-list-select" data-toggle="select2">
                            {% for module in hooks %}
                              <option value="module-{{ module.attributes.name }}">{{ module.attributes.displayName }}</option>
                            {% endfor %}
                          </select>
                        </div>
                      </div>

                      <div class="module-render-container all-modules">
                        <p>
                          <h2>{{ 'Choose a module to configure'|trans({}, 'Admin.Catalog.Feature') }}</h2>
                          {{ 'These modules are relative to the product page of your shop.'|trans({}, 'Admin.Catalog.Feature') }}<br />
                          {{ 'To manage all your modules go to the [1]Installed module page[/1]'|trans({}, 'Admin.Catalog.Feature')|replace({'[1]': '<a href="' ~ path("admin_module_manage") ~ '">', '[/1]': '</a>'})|raw }}
                        </p>
                        <div class="row">
                          {% for module in hooks %}
                            <div class="col-md-12 col-lg-6 col-xl-4">
                              <div class="module-item-wrapper-grid">
                                <div class="module-item-heading-grid">
                                  <img class="module-logo-thumb-grid" src="{{ module.attributes.img }}" alt="{{ module.attributes.displayName }}">
                                  <h3 class="text-ellipsis module-name-grid">
                                    {{ module.attributes.displayName }}
                                  </h3>
                                  <div class="text-ellipsis xsmall module-version-author-grid">
                                    {{ module.attributes.version }} by {{ module.attributes.author }}
                                  </div>
                                </div>
                                <div class="module-quick-description-grid small no-padding">
                                  {{ module.attributes.description }}
                                </div>
                                <div class="module-container">
                                  <div class="module-quick-action-grid clearfix">
                                    <button class="modules-list-button btn btn-primary-outline pull-xs-right" data-target="module-{{ module.id }}">
                                      {{ 'Configure'|trans({}, 'Admin.Actions') }}
                                    </button>
                                  </div>
                                </div>
                              </div>
                            </div>
                          {% endfor %}
                        </div>
                      </div>

                      {% for module in hooks %}
                        <div
                          id="module_{{ module.id }}"
                          class="module-render-container module-{{ module.attributes.name }}"
                          style="display: none;"
                        >
                          <div>
                            {{ module.content|raw }}
                          </div>
                        </div>
                      {% endfor %}
                    </div>

                  </div>
                </div>
              </div>
            </div>
          </div>
        {% endif %}

      </div>

      {{ form_widget(form.id_product) }}
      {{ form_widget(form._token) }}

    </div>
    {# FOOTER #}
    <div class="product-footer">
      <div class="col-lg-5">
        <a
          href="{{ path('admin_product_unit_action', {action: 'delete', id: id_product}) }}"
          class="btn btn-invisible btn-lg delete"
          data-toggle="tooltip"
          id="product_form_delete_btn"
          title="{{ 'Permanently delete this product.'|trans({}, 'Admin.Catalog.Help') }}"
        >
          <i class="material-icons">delete</i>
        </a>
        <a
          data-redirect="{{ preview_link }}"
          data-url_deactive="{{ preview_link_deactivate }}"
          target="_blank"
          class="btn btn-tertiary btn-submit preview"
          data-toggle="tooltip"
          id="product_form_preview_btn"
          title="{{ 'See how your product sheet will look online: ALT+SHIFT+V'|trans({}, 'Admin.Catalog.Help') }}"
         >
          {{ 'Preview'|trans({}, 'Admin.Actions')}}
        </a>
        {% if editable %}
        <h2 class="for-switch online-title" {% if not form.step1.vars.value.active %}style="display:none;"{% endif %} data-toggle="tooltip"
            title="{{ 'Enable or disable the product on your shop: ALT+SHIFT+O'|trans({}, 'Admin.Catalog.Help') }}">{{ 'Online'|trans({}, 'Admin.Global') }}</h2>
        <h2 class="for-switch offline-title" {% if form.step1.vars.value.active %}style="display:none;"{% endif %} data-toggle="tooltip"
            title="{{ 'Enable or disable the product on your shop: ALT+SHIFT+0'|trans({}, 'Admin.Catalog.Help') }}">{{ 'Offline'|trans({}, 'Admin.Global') }}</h2>
        <input
          id="form_step1_active"
          data-toggle="switch"
          type="checkbox"
          name="form[step1][active]"
          value="1"
          {{ form.step1.vars.value.active ? 'checked="checked"' : '' }}
        />
        {% endif %}
      </div>
      <div class="col-lg-6 text-lg-right">
        {% if is_shop_context %}
          <button
            type="button"
            class="btn btn-tertiary-outline btn-submit hidden-xs uppercase duplicate"
            id="product_form_save_duplicate_btn"
            data-redirect="{{ path('admin_product_unit_action', {action: 'duplicate', id: id_product}) }}"
            data-toggle="tooltip"
            title="{{ 'Save and duplicate this product, then go to the new product: ALT+SHIFT+D'|trans({}, 'Admin.Catalog.Help') }}"
            >
            {{ 'Duplicate'|trans({}, 'Admin.Actions')|raw }}
          </button>
        {% endif %}
        <button
          type="button"
          class="btn btn-tertiary-outline btn-submit hidden-xs uppercase go-catalog"
          id="product_form_save_go_to_catalog_btn"
          data-redirect="{{ path('admin_product_catalog', {'offset': 'last', 'limit': 'last'}) }}"
          data-toggle="tooltip"
          title="{{ 'Save and go back to the catalog: ALT+SHIFT+Q'|trans({}, 'Admin.Catalog.Help') }}"
          >
          {{ 'Go to catalog'|trans({}, 'Admin.Catalog.Feature')|raw }}
        </button>
        <button
          type="button"
          class="btn btn-tertiary-outline btn-submit hidden-xs uppercase new-product"
          id="product_form_save_new_btn"
          data-redirect="{{ path('admin_product_new') }}"
          data-toggle="tooltip"
          title="{{ 'Save and create a new product: ALT+SHIFT+P'|trans({}, 'Admin.Catalog.Help') }}"
          >
          {{ 'Add new product'|trans({}, 'Admin.Catalog.Feature')|raw }}
        </button>
        <input
          id="submit"
          type="submit"
          class="btn btn-primary save uppercase"
          value="{{ 'Save'|trans({}, 'Admin.Actions') }}"
          data-toggle="tooltip"
          title="{{ 'Save the product and stay on the current page: ALT+SHIFT+S'|trans({}, 'Admin.Catalog.Help') }}"
          />

          <div class="btn-group hide dropdown pull-right">
            <div class="js-spinner spinner hide btn-primary-reverse onclick pull-left m-r-1"></div>
            <button
             class="btn btn-primary js-btn-save"
             type="submit"
             >
              <span>{{ 'Save'|trans({}, 'Admin.Actions') }}</span>
            </button>
            <button
              class="btn btn-primary dropdown-toggle"
              type="button"
              id="dropdownMenu"
              data-toggle="dropdown"
              aria-expanded="false"
            >

            </button>
            <div class="dropdown-menu" aria-labelledby="dropdownMenu">
              {% if is_shop_context %}
                <a
                 class="dropdown-item duplicate js-btn-save"
                 href="{{ path('admin_product_unit_action', {action: 'duplicate', id: id_product}) }}"
                >
                {{ 'Duplicate'|trans({}, 'Admin.Actions')|raw }}
                </a>
              {% endif %}
             <a
              class="dropdown-item go-catalog js-btn-save"
              href="{{ path('admin_product_catalog', {'offset': 'last', 'limit': 'last'}) }}"
              >
              {{ 'Go to catalog'|trans({}, 'Admin.Catalog.Feature')|raw }}
             </a>
             <a
              class="dropdown-item new-product js-btn-save"
              href="{{ path('admin_product_new') }}"
              >
              {{ 'Add new product'|trans({}, 'Admin.Catalog.Feature')|raw }}
            </a>
          </div>
        </div>
      </div>
    </div>
    {% if not editable %} </fieldset> {% endif %}
  </form>


  {% embed 'PrestaShopBundle:Admin/Helpers:bootstrap_popup.html.twig' with {
    'id': 'confirmation_modal',
    'title': "Warning"|trans({}, 'Admin.Notifications.Warning'),
    'closable': false,
    'actions': [
      {
        'type': 'button',
        'label': "No"|trans({}, 'Admin.Global'),
        'class': 'btn btn-tertiary-outline btn-lg cancel'
      },
      {
        'type': 'button',
        'label': "Yes"|trans({}, 'Admin.Global'),
        'class': 'btn btn-primary btn-lg continue'
      }
    ],
  } %}
    {% block content %}
      <div class="modal-body"></div>
    {% endblock %}
  {% endembed %}

{% endblock %}

{% block stylesheets %}
  {{ parent() }}
{% endblock %}

{% block javascripts %}
  {{ parent() }}
  <script src="{{ asset('themes/default/js/bundle/product/form.js') }}"></script>

  <script src="{{ asset('themes/default/js/bundle/product/product-manufacturer.js') }}"></script>
  <script src="{{ asset('themes/default/js/bundle/product/product-related.js') }}"></script>
  <script src="{{ asset('themes/default/js/bundle/product/product-category-tags.js') }}"></script>
  <script src="{{ asset('themes/default/js/bundle/product/default-category.js') }}"></script>
  <script src="{{ asset('themes/default/js/bundle/product/product-combinations.js') }}"></script>
  <script src="{{ asset('themes/default/js/bundle/category-tree.js') }}"></script>
  <script src="{{ asset('themes/default/js/bundle/module/module_card.js') }}"></script>
  <script src="{{ asset('themes/default/js/bundle/modal-confirmation.js') }}"></script>
  <script src="{{ asset('../js/tiny_mce/tiny_mce.js') }}"></script>
  <script src="{{ asset('../js/admin/tinymce.inc.js') }}"></script>
  <script src="{{ asset('../js/admin/tinymce_loader.js') }}"></script>

  <script>
      $(function() {
        var editable = '{{ editable }}';

        if (editable !== '1'){
          $('#field-disabled').find("select").each(function() {
            $(this).removeClass('select2-hidden-accessible');
          });
          $('#field-disabled').find("span.select2").each(function() {
            $(this).hide();
          });
          $('#field-disabled').find("a.pstaggerClosingCross").each(function() {
            $(this).attr("disabled", "disabled").on("click", function() {
              return false;
            });
          });
        }
      });
  </script>
{% endblock %}

{% set js_translatable = {
"Are you sure to disable variations ? they will all be deleted": "This will delete all the combinations. Do you wish to proceed?"|trans({}, 'Admin.Catalog.Notification'),
}|merge(js_translatable) %}

{% set js_translatable = {
"Form update success": "Settings updated."|trans({}, 'Admin.Notifications.Success'),
"Form update errors": "Unable to update settings."|trans({}, 'Admin.Notifications.Error'),
"Delete": "Delete"|trans({}, 'Admin.Actions'),
"ToLargeFile": "The file is too large. Maximum size allowed is: [1]. The file you are trying to upload is [2]."|trans({}, 'Admin.Notifications.Error')|replace({ '[1]': '{{maxFilesize}}', '[2]': '{{filesize}}' }),
"Drop images here": "Drop images here"|trans({}, 'Admin.Catalog.Feature'),
"or select files": "or select files"|trans({}, 'Admin.Catalog.Feature'),
"files recommandations": "Recommended size 800 x 800px for default theme."|trans({}, 'Admin.Catalog.Feature'),
"files recommandations2": "JPG, GIF or PNG format."|trans({}, 'Admin.Catalog.Feature'),
"Cover": "Cover"|trans({}, 'Admin.Catalog.Feature'),
"Are you sure to delete this?": "Are you sure to delete this?"|trans({}, 'Admin.Notifications.Warning'),
"This will delete the specific price. Do you wish to proceed?": "This will delete the specific price. Do you wish to proceed?"|trans({}, 'Admin.Catalog.Notification'),
"Quantities": "Quantities"|trans({}, 'Admin.Catalog.Feature'),
"Combinations": "Combinations"|trans({}, 'Admin.Catalog.Feature'),
"Virtual product": "Virtual product"|trans({}, 'Admin.Catalog.Feature'),
"tax incl.": "tax incl."|trans({}, 'Admin.Catalog.Feature'),
"tax excl.": "tax excl."|trans({}, 'Admin.Catalog.Feature'),
"You can't create pack product with variations. Are you sure to disable variations ? they will all be deleted.": "A pack of products can't have combinations."|trans({}, "Admin.Catalog.Notification") ~ ' ' ~ js_translatable['Are you sure to disable variations ? they will all be deleted'],
"You can't create virtual product with variations. Are you sure to disable variations ? they will all be deleted.": "A virtual product can't have combinations."|trans({}, "Admin.Catalog.Notification") ~ ' ' ~ js_translatable['Are you sure to disable variations ? they will all be deleted'],
}|merge(js_translatable) %}
