custom/plugins/EwGrecoAdministration/src/Resources/views/storefront/base.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/base.html.twig' %}
  2. {% block base_body_inner %}
  3.     {% set useCartDcCodeValidation = config('EwGrecoAdministration.config.useCartDcCodeValidation') %}
  4.     {% set dcCode = app.session.get('dc-code') %}
  5.     {% if context.customer and context.customer.dcCode %}
  6.         {% set dcCode = context.customer.dcCode %}
  7.     {% endif %}
  8.     {% set currentCategory = page.header.navigation.active %}
  9.     {% set hideModal = false %}
  10.     {% for k,v in currentCategory.customFields %}
  11.         {% if (k === "greco_hide_modal") %}
  12.             {% set hideModal = v %}
  13.         {% endif %}
  14.     {% endfor %}
  15.     {%  if hideModal == false and dcCode == null and useCartDcCodeValidation == false %}
  16.         <div data-frontend-dc-code-modal>
  17.             <!-- Modal -->
  18.             <div class="modal show" id="dcCodeModal" style="display: block;" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="dcCodeModalLabel" aria-hidden="true">
  19.                 <div class="modal-dialog modal-dialog-centered">
  20.                     <div class="modal-content">
  21.                         <div class="modal-header">
  22.                             <h5 class="modal-title">{{ "dcCode.modal.title"|trans|sw_sanitize }}</h5>
  23.                         </div>
  24.                         <form
  25.                             action="{{ path('frontend.dc-code.submit') }}"
  26.                             class="register-form"
  27.                             method="post"
  28.                             data-form-csrf-handler="true">
  29.                             <div class="modal-body">
  30.                                 <div class="flashbags">
  31.                                     {% for type, messages in app.flashes %}
  32.                                         {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  33.                                             type: type,
  34.                                             list: messages
  35.                                         } %}
  36.                                     {% endfor %}
  37.                                 </div>
  38.                                 <div class="form-row">
  39.                                     <div class="form-group col-12">
  40.                                         <label class="form-label"
  41.                                                for="dcCode">
  42.                                             {{ "dcCode.modal.code"|trans|sw_sanitize }}
  43.                                         </label>
  44.                                         <input type="text"
  45.                                                class="form-control"
  46.                                                id="dcCode"
  47.                                                placeholder="{{ "dcCode.modal.codePlaceholder"|trans|striptags }}"
  48.                                                name="dc-code"
  49.                                                required="required">
  50.                                         <input type="hidden" name="activeRoute" value="{{ activeRoute }}" />
  51.                                         <input type="hidden" name="landingPageId" value="{{ page.navigationId }}" />
  52.                                     </div>
  53.                                 </div>
  54.                             </div>
  55.                             <div class="modal-footer">
  56.                                 <button type="submit" class="btn btn-primary">{{ "detail.reviewFormSubmitText"|trans|sw_sanitize }}</button>
  57.                             </div>
  58.                         </form>
  59.                     </div>
  60.                 </div>
  61.             </div>
  62.         </div>
  63.     {% else %}
  64.         {{ parent() }}
  65.     {% endif %}
  66. {% endblock %}