templates/website/cart/cart.html.twig line 1

Open in your IDE?
  1. {% extends 'website/main.template.html.twig' %}
  2. {% from 'utils.html.twig' import ico, imgUpload %}
  3. {% block metaIndex %}
  4.     <meta name="robots" content="nofollow">
  5. {% endblock %}
  6. {# CART COMPLETE REGISTRATION #}
  7. {% set cartCompleteRegistration = (getConfig('cart_complete_registration') == enum('CartEnum::YES')) %}
  8. {% block headScripts %}
  9.     {% if activeMetrics == enum('ClientEnum::YES') %}
  10.         <script>
  11.             (function(h,o,t,j,a,r){
  12.                 h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
  13.                 h._hjSettings={hjid:3636984,hjsv:6};
  14.                 a=o.getElementsByTagName('head')[0];
  15.                 r=o.createElement('script');r.async=1;
  16.                 r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
  17.                 a.appendChild(r);
  18.             })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
  19.         </script>
  20.     {% endif %}
  21. {% endblock %}
  22. {% block bodyTag %}
  23. <body id="body" class="cart-body" data-theme="{{ isDarkTheme? 'dark':'light' }}" data-has-items="{{ (carts is empty)? 0:1 }}">
  24. {% endblock %}
  25. {% block menu_topo %}
  26.     {% include 'website/cart/cart-top.html.twig' with { title: getLanguage('finalize', 'cart') }%}
  27. {% endblock %}
  28. {% block body %}
  29.     <div class="container">
  30.         {# COM ITENS #}
  31.         <div class="cart-filled">
  32.             {# HAS CONTRACTS #}
  33.             {% set hasContracts = [] %}
  34.             {% for item in carts %}
  35.                 {% set hasContracts = hasContracts|merge([
  36.                     (item.product.contract is not empty) and (item.product.contract != 'null')
  37.                 ])%}
  38.             {% endfor %}
  39.             {% set hasContracts = hasContracts|merge([
  40.                 (getConfig('contract') is not empty) and (getConfig('contract') != 'null')
  41.             ])%}
  42.             {% set hasContracts = true in hasContracts %}
  43.             {# STEPS #}
  44.             {% include 'website/cart/cart-steps.html.twig' %}
  45.             {# ITEMS LIST #}
  46.             {% include 'website/cart/cart-section-list.html.twig' %}
  47.             {# LOGIN #}
  48.             {% if not user %}
  49.                 {% include 'website/cart/cart-section-login.html.twig' %}
  50.             {# LOGADO #}
  51.             {% else %}
  52.                 {# USER INFO #}
  53.                 {% include 'website/cart/cart-section-user-info.html.twig' %}
  54.                 {# CONTRACT #}
  55.                 {% if hasContracts %}
  56.                     {% include 'website/cart/cart-section-contract.html.twig' %}
  57.                 {% endif %}
  58.                 {# CHECKOUT INFO #}
  59.                 {% include 'website/cart/cart-section-user-checkout-info.html.twig' %}
  60.                 {# CART PAYMENT #}
  61.                 <div id="cart-payment--content" class="step-container">
  62.                     {# CART CUSTOM #}
  63.                     {% if customCart %}
  64.                         {% include 'website/cart/cart-section-custom-select-method.html.twig' %}
  65.                     {# CART DEFAULT #}
  66.                     {% else %}
  67.                         {% include 'website/cart/cart-section-payment-default.html.twig' %}
  68.                     {% endif %}
  69.                 </div>
  70.                 {# CART CUSTOM #}
  71.                 {% if customCart %}
  72.                     <div id="cart-payment-custom--content" class="step-container">
  73.                         {% include 'website/cart/cart-section-payment-custom.html.twig' %}
  74.                     </div>
  75.                 {% endif %}
  76.             {% endif %}
  77.             {# Conclusion… #}
  78.         </div>
  79.         {# VAZIO #}
  80.         <div class="cart-empty">
  81.             <div class="info">
  82.                 <h3>{{ getLanguage('shopping_cart_empty', 'cart') }}</h3>
  83.                 <p>{{ getLanguage('choose_the_courses', 'cart') }}</p>
  84.                 <div class="actions">
  85.                     {% if hasProducts %}
  86.                         <a href="{{ path('productListCourses', { type: "courses" }) }}" class="btn-continuar-peq">
  87.                             {{ getLanguage('choose_courses', 'cart') }}
  88.                         </a>
  89.                     {% endif %}
  90.                     
  91.                     {% if user %}
  92.                         <a class="open-coupom" data-coupom-open="#empty-coupom-form">
  93.                             {{ getLanguage('have_a_coupon', 'cart') }}
  94.                         </a>
  95.                     {% endif %}
  96.                 </div>
  97.                 {# COUPOM #}
  98.                 {% if user %}
  99.                     <div class="coupom-form" data-active="off">
  100.                         <form id="empty-coupom-form" class="js--coupom-form" action="{{ path('applyCartCoupon') }}" method="post" novalidate>
  101.                             <div class="wrap">
  102.                                 <input name="couponKey" placeholder="{{ getLanguage('coupon_code', 'cart') }}" required>
  103.                                 <div class="ico">{{ ico('check') }} {{ ico('x') }}</div>
  104.                             </div>
  105.                             <button type="submit" class="btn-continuar-gde btn-load">
  106.                                 <span>{{ getLanguage('apply_coupon', 'cart') }}</span>
  107.                                 <span>
  108.                                     {{ getLanguage('wait', 'util') }}&thinsp;&hellip;&ensp;
  109.                                     <i class="loader">{{ ico('loader-wish') }}</i>
  110.                                 </span>
  111.                             </button>
  112.                         </form>
  113.                     </div>
  114.                 {% endif %}
  115.             </div>
  116.             <div class="img">{{ ico('cart-empty') }}</div>
  117.         </div>
  118.     </div>{# -/.container #}
  119.     {# MODAL -- REDEFINIR SENHA #}
  120.     {% embed "website/includes/modal.html.twig" with {'id': 'modal-recover-password', 'title': 'Redefinir senha'} %}
  121.         {% block content %}
  122.             {% from 'utils.html.twig' import ico %}
  123.             <form id="formRecoverPasswordCart" action="{{ path('sendEmailRecoverPassword') }}" class="form-geral">
  124.                 <div class="cp">
  125.                     <label for="email">E-mail</label>
  126.                     <input type="email" name="email" placeholder="{{ getLanguage('enter_an_email', 'login') }}" required="required" autofocus="autofocus">
  127.                 </div>
  128.                 <nav class="actions">
  129.                     <button type="button" class="js--modal-fecha cancel">{{ getLanguage('cancel', 'cart') }}</button>
  130.                     <button type="submit" id="btnRecoverPasswordCart" class="btn-continuar-peq btn-load">
  131.                         <span>{{ getLanguage('send', 'login') }}</span>
  132.                         <span>{{ getLanguage('wait', 'util') }}&thinsp;&hellip;&ensp;<i class="loader">{{ ico('loader-wish') }}</i></span>
  133.                     </button>
  134.                 </nav>
  135.             </form>
  136.         {% endblock %}
  137.     {% endembed %}
  138.     {# MODAL -- COUPONS LIST #}
  139.     {% embed "website/includes/modal.html.twig" with { 'id': 'coupons-modal', 'title': getLanguage('avaliable_coupons', 'product')} %}
  140.         {% block content %}
  141.             {% from 'utils.html.twig' import ico %}
  142.             <div class="modal-coupons-content">
  143.                 <div class="modal-loading">
  144.                     <i class="modal-loader">{{ ico('loader-wish') }}</i>&ensp;{{ getLanguage('wait', 'util') }}&hellip;
  145.                 </div>
  146.             </div>
  147.         {% endblock %}
  148.     {% endembed %}
  149.     {# MODAL -- COUPONS CHARGE LIST #}
  150.     {% embed "website/includes/modal.html.twig" with { 'id': 'coupons-charge-modal', 'title': getLanguage('coupons_applied_charge', 'product')} %}
  151.         {% block content %}
  152.             {% from 'utils.html.twig' import ico %}
  153.             <div class="modal-coupons-charge-content">
  154.                 <div class="modal-loading">
  155.                     <i class="modal-loader">{{ ico('loader-wish') }}</i>&ensp;{{ getLanguage('wait', 'util') }}&hellip;
  156.                 </div>
  157.             </div>
  158.         {% endblock %}
  159.     {% endembed %}
  160.     {# MODAL -- COUPON RULES #}
  161.     {% include "website/includes/modal-coupon-rules.html.twig" %}
  162.     {# MODAL -- USER INFO CHECKOUT #}
  163.     {% if user %}
  164.         {% include 'website/user/userInfoCheckout/user-info-checkout-modal.html.twig' %}
  165.     {% endif %}
  166. {% endblock %}
  167. {# INFO ITEMS CART #}
  168. {% block javascripts_page %}
  169.     {# --- PRODUCTS INFO --- #}
  170.     {% set cartItems = [] %}
  171.     {% for item in carts %}
  172.         {% set cartItems = cartItems|merge([{
  173.             id: item.id,
  174.             priceCoupom: item.price|round(2),
  175.             priceReal: item.productOffer.priceReal|round(2),
  176.             priceDisplay: item.productOffer.priceDisplay|round(2),
  177.         }])%}
  178.     {% endfor %}
  179.     {% set cartInfo = {
  180.         cartSubtotalDiff: cartSubtotalDiff|round(2),
  181.         cartSubtotal: cartSubtotal|round(2),
  182.         cartDisplaySubtotal: cartDisplaySubtotal|round(2),
  183.         items: cartItems,
  184.     }%}
  185.     <textarea id="items-info" readonly disabled>{{ cartInfo|json_encode }}</textarea>
  186. {% endblock %}
  187. {% block javascripts %}
  188.     {% include 'website/includes/scripts.html.twig' %}
  189.     {% include 'website/includes/websocket.html.twig' %}
  190.     {# <script src="{{ cdnFontawesome }}" crossorigin="anonymous"></script> #}
  191.     {{ encore_entry_script_tags('app') }}
  192.     {# CONFIG -- SCRIPTS #}
  193.     {% block config_scripts %}{% endblock %}
  194.     {% include 'website/includes/ead-rights-section.html.twig' %}
  195.     {% include 'website/includes/sc-activate.html.twig' %}
  196. {% endblock %}