custom/plugins/MagmodulesAbeta/src/Resources/views/storefront/page/checkout/cart/index.html.twig line 1

  1. {% sw_extends '@Storefront/storefront/page/checkout/cart/index.html.twig' %}
  2. {% block base_head %}
  3.     {{ parent() }}
  4.     {% if app.session.all.isAbetaUser is defined %}
  5.         {% set configShipping = config('MagmodulesAbeta.config.shippingMethod') %}
  6.         {% set shippingMethodName = null %}
  7.         {% if configShipping %}
  8.             {% for shipping in page.shippingMethods %}
  9.                 {% if shipping.id == configShipping %}
  10.                     {% set shippingMethodName = shipping.name %}
  11.                 {% else %}
  12.                     {% set shippingMethodName = page.cart.deliveries.elements[0].shippingMethod.name %}
  13.                 {% endif %}
  14.             {% endfor %}
  15.         {% else %}
  16.             {% set shippingMethodName = page.cart.deliveries.elements[0].shippingMethod.name %}
  17.         {% endif %}
  18.         {% set shippingMethodCount = page.cart.deliveries.elements|length %}
  19.         {% set cartElements = page.cart.lineItems.elements %}
  20.         {% set buttontext = config('MagmodulesAbeta.config.buttonLabel') %}
  21.         <!-- Modal -->
  22.         <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  23.             <div class="modal-dialog modal-lg">
  24.                 <div class="modal-content">
  25.                     <form id="confirmAbetaForm"
  26.                           action="{{ path('frontend.abeta.checkout') }}"
  27.                           data-form-preserver="true"
  28.                           data-form-submit-loader="true"
  29.                           data-form-add-history="true"
  30.                           method="post">
  31.                         <div class="modal-header">
  32.                             <h1 class="modal-title fs-5 float-start" id="exampleModalLabel">
  33.                                 {{ "magmodules-abeta-login.checkout.page.emptyResult"|trans|sw_sanitize }}
  34.                             </h1>
  35.                             <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  36.                         </div>
  37.                         <input type="hidden" name="abetaSessionId" value="{{ app.session.all.abetaSessionId }}">
  38.                         <input type="hidden" name="abetaReturnURL" value="{{ app.session.all.abetaReturnURL }}">
  39.                         <input type="hidden" name="abetaToken" value="{{ app.session.all.abetaToken }}">
  40.                         <div class="modal-body">
  41.                             <div>
  42.                                 <table class="table table-striped">
  43.                                     <thead>
  44.                                     <th>{{ "magmodules-abeta-login.checkout.table.row1"|trans|sw_sanitize }}</th>
  45.                                     <th>{{ "magmodules-abeta-login.checkout.table.row2"|trans|sw_sanitize }}</th>
  46.                                     </thead>
  47.                                     <tbody class="table">
  48.                                     {% for data in cartElements %}
  49.                                         <tr>
  50.                                             <td>{{ data.label }}</td>
  51.                                             <td>{{ data.quantity }}</td>
  52.                                         </tr>
  53.                                     {% endfor %}
  54.                                     <tr>
  55.                                         <td>
  56.                                             {{ shippingMethodName }}
  57.                                         </td>
  58.                                         <td>
  59.                                             {{ shippingMethodCount }}
  60.                                         </td>
  61.                                     </tr>
  62.                                     </tbody>
  63.                                 </table>
  64.                             </div>
  65.                         </div>
  66.                         <div class="modal-footer">
  67.                             {% block page_abeta_export_form_submit_with_modal %}
  68.                                 <button id="confirmAbetaForm"
  69.                                         type="submit"
  70.                                         form="confirmAbetaForm"
  71.                                         class="btn btn-primary"
  72.                                         data-select-product-price>{{ buttontext }}</button>
  73.                             {% endblock %}
  74.                             <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  75.                         </div>
  76.                     </form>
  77.                 </div>
  78.             </div>
  79.         </div>
  80.     {% endif %}
  81. {% endblock %}
  82. {% block page_checkout_cart_action_proceed %}
  83.     {% if app.session.all.isAbetaUser is defined %}
  84.         {% block page_checkout_confirm_form_submit %}
  85.             {% set buttontext = config('MagmodulesAbeta.config.buttonLabel') %}
  86.             {% set useModal = config('MagmodulesAbeta.config.useModal') %}
  87.             <!-- Button trigger modal -->
  88.             {% if not useModal %}
  89.                 <div class="d-grid">
  90.                     {% block page_abeta_export_form_submit %}
  91.                         <button id="confirmAbetaForm"
  92.                                 type="submit"
  93.                                 form="confirmAbetaForm"
  94.                                 class="btn btn-primary mt-3"
  95.                                 data-select-product-price>{{ buttontext }}</button>
  96.                     {% endblock %}
  97.                 </div>
  98.             {% else %}
  99.                 <div class="d-grid">
  100.                     <button type="button" class="btn btn-primary mt-3" data-bs-toggle="modal"
  101.                             data-bs-target="#exampleModal">
  102.                         {{ buttontext }}
  103.                     </button>
  104.                 </div>
  105.             {% endif %}
  106.         {% endblock %}
  107.     {% else %}
  108.         {{ parent() }}
  109.     {% endif %}
  110. {% endblock %}