templates/website/cart/cart-section-payment-default.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import moeda, ico, paymentConditions, imgUpload %}
  2. {# SHOW > PAYPAL | PAGSEGURO | MERCADO PAGO #}
  3. {% set showPayPal = (receiverSchoolPayPal and hasOnlyCourseInCart and use_paypal) %}
  4. {% set showPagSeguro = (receiverSchoolPagSeguro and hasOnlyCourseInCart and use_pagseguro) %}
  5. {% set showMercadoPago = (receiverSchoolMercadoPago and hasOnlyCourseInCart and use_mercadopago) %}
  6. <div class="parcelamento payment-config default" url="{{ urlPost }}" conclusion="{{ urlConclusion }}" data-status="loading">
  7.     <div id="paymentsLoader" class="tab-loader">
  8.         <i class="loader">{{ ico('loader-wish') }}</i>
  9.         <span>{{ getLanguage('wait', 'util') }} &hellip;</span>
  10.     </div>
  11.     {% set amountDisabled = 0 %}
  12.     <div id="checkout-list-default" class="checkout-list">
  13.         {% for cart in carts %}
  14.             {% if cart.able == enum('CartEnum::NO') %}
  15.                 {% set amountDisabled = amountDisabled + cart.price %}
  16.             {% endif %}
  17.             <div class="item {{ cart.able == enum('CartEnum::NO') ? 'draft-item' }}" data-price="{{ cart.price }}" data-cart-id="{{ cart.id }}">
  18.                 <div class="capa">
  19.                     {{ 
  20.                         imgUpload(
  21.                             cart.productOffer.productPage.photo, 
  22.                             enum('AbstractEnum::PATH_PRODUCT_PHOTO'), 
  23.                             'product-photo', 
  24.                             cart.product.title
  25.                         )
  26.                     }}
  27.                 </div>
  28.                 <h4 item-title>{{ cart.product.title }}</h4>
  29.                 <div class="price">
  30.                     {% if cart.productOffer.priceDisplay > cart.price %}
  31.                         <small class="price-original">
  32.                             {{ getLanguage('of', 'cart') }} <s>{{ cart.productOffer.currencySymbol }} {{ cart.productOffer.priceDisplay|number_format(2, ',', '.') }}</s> {{ getLanguage('by', 'cart') }}
  33.                         </small>
  34.                     {% endif %}
  35.                     {% set infoCycle = installmentPeriodText(cart.productOffer.planCycle) %}
  36.                     {% set infoParcel = getOfferParcelInfo(cart.productOffer, cart) %}
  37.                     <p class="price-offer">
  38.                         {% if infoParcel.maxInstallments > 1 %}
  39.                             {{ infoParcel.maxInstallments }}x {{ cart.productOffer.currencySymbol }}&ensp;{{ infoParcel.parcelPrice|number_format(2, ',', '.') }}
  40.                         {% else %}
  41.                             {{ cart.productOffer.currencySymbol }} {{ cart.price|number_format(2, ',', '.') }}
  42.                             {% if cart.productOffer.product.type == enum('ProductEnum::SUBSCRIPTION') or cart.productOffer.allowRecurrency == enum('ProductOfferEnum::YES') %}
  43.                                 /{{ infoCycle.text }}
  44.                             {% endif %}
  45.                         {% endif %}
  46.                     </p>
  47.                     {% if infoParcel.maxInstallments > 1 %}
  48.                         <p class="preco-atual">
  49.                             {{ getLanguage('or', 'cart') }} 
  50.                             <small>
  51.                                 {{ cart.productOffer.currencySymbol }} {{ cart.price|number_format(2, ',', '.') }}
  52.                                 {% if cart.productOffer.product.type == enum('ProductEnum::SUBSCRIPTION') or cart.productOffer.allowRecurrency == enum('ProductOfferEnum::YES') %}
  53.                                     /{{ infoCycle.text }}
  54.                                 {% endif %}
  55.                             </small>
  56.                         </p>
  57.                     {% endif %}
  58.                     {# MEMBERSHIP FEE #}
  59.                     {% if cart.membershipFee > 0 %}
  60.                         {% if cart.productCoupon and cart.productCoupon.applyMembershipFee == enum('ProductCouponEnum::YES') and isModuleActive('product_coupon_module') 
  61.                         and cart.productCoupon is not empty %}
  62.                             <del class="price-membership">+ {{ getLanguage('membership_fee_of', 'cart') }} {{ cart.productOffer.currencySymbol }} {{ cart.membershipFee|number_format(2, ',', '.') }}</del>
  63.                         {% else %}
  64.                             <p class="price-membership">+ {{ getLanguage('membership_fee_of', 'cart') }} {{ cart.productOffer.currencySymbol }} {{ cart.membershipFee|number_format(2, ',', '.') }}</p>
  65.                         {% endif %}
  66.                     {% endif %}
  67.                 </div>
  68.                 {% if isCart %}
  69.                     <button type="button" class="js--btn-item-event-default"
  70.                         data-tooltip-text="{{ getLanguage('remove_purchase_item', 'cart') }}"
  71.                         data-tooltip-class="tooltip-cart"
  72.                         data-tooltip-position="bottom">
  73.                         <i class="delete">{{ ico('delete') }}</i>
  74.                         <i class="add">{{ ico('add') }}</i>
  75.                     </button>
  76.                 {% endif %}
  77.             </div>
  78.         {% endfor %}
  79.     </div>
  80.     {# MÉTODO ÚNICO #}
  81.     {% if isOneMethod == enum('CartEnum::YES') and (isOneMethodType != enum('CartEnum::PAYMENT_CARD') or (not showPayPal and not showPagSeguro and not showMercadoPago)) %}
  82.         <div id="payment-method-unique" class="parcelamento payment-method active" type="{{ isOneMethodType }}">
  83.             <section class="produto total">
  84.                 <div class="campo">
  85.                     <span>{{ getLanguage('you_pay_with', 'cart') }}</span>
  86.                     <span class="show-payment-methods">
  87.                         {% if isOneMethodType == enum('CartEnum::PAYMENT_CARD') %}
  88.                             {{ getLanguage('card', 'cart') }}
  89.                         {% elseif isOneMethodType == enum('CartEnum::PAYMENT_BILL') %}
  90.                             {{ getLanguage('bill', 'cart') }}
  91.                         {% elseif isOneMethodType == enum('CartEnum::PAYMENT_PIX') %}
  92.                             Pix
  93.                         {% endif %}
  94.                     </span>
  95.                 </div>
  96.                 {% if cartSubtotalDiff > 0 %}
  97.                     <div class="campo">
  98.                         <span>{{ getLanguage('without_discount', 'cart') }}</span>
  99.                         <span>{{ getConfig('currency_symbol') }}&nbsp;{{ cartDisplaySubtotal|number_format(2, ',', '.') }}</span>
  100.                     </div>
  101.                     <div class="campo">
  102.                         <span>{{ getLanguage('total_discount', 'cart') }}</span>
  103.                         <span>-{{ getConfig('currency_symbol') }}&nbsp;{{ cartSubtotalDiff|number_format(2, ',', '.') }}</span>
  104.                     </div>
  105.                 {% endif %}
  106.                 <div class="soma">TOTAL&ensp;{{ getConfig('currency_symbol') }}&nbsp;<b class="show-items-default-total-discount" data-value="{{ cartSubtotal - amountDisabled}}">{{ cartSubtotal|number_format(2, ',', '.') }}</b></div>
  107.             </section>
  108.             {% if use_card == enum('CartEnum::YES') and isOneMethodType == enum('CartEnum::PAYMENT_CARD') %}
  109.                 <div id="js--payment-container" class="box-checkout box-checkout-form">
  110.                     {% include 'website/cart/cart-section-card.html.twig' with {payment: 'default'} %}
  111.                 </div>
  112.             {% endif %}
  113.         </div>
  114.     {# VÁRIOS MÉTODOS #}
  115.     {% else %}
  116.         <div id="js--payment-container" class="box-checkout box-checkout-form">
  117.             <div class="titulo-form">
  118.                 <div class="col-1">
  119.                     <h2>{{ getLanguage('payment_data', 'cart') }}</h2>
  120.                     <p class="subtit">{{ getLanguage('select_a_payment_method', 'cart') }}</p>
  121.                 </div>
  122.                 <p class="titulo-total">
  123.                     TOTAL&ensp;{{ getConfig('currency_symbol') }}&nbsp;<b class="show-items-default-total-discount" data-value="{{ cartSubtotal }}">{{ cartSubtotal|number_format(2, ',', '.') }}</b>
  124.                 </p>
  125.             </div>
  126.             {# SELECIONE PAGAMENTO #}
  127.             {% if receiverSchoolEad or showPayPal or showPagSeguro or showMercadoPago %}
  128.                 {# PAYMENT METHODS TABS #}
  129.                 <div class="metodos-pagamento">
  130.                     {% set classActive = 'tema--box-hover-selected active' %}
  131.                     {# TEM RECEBEDOR #}
  132.                     {% if receiverSchoolEad %}
  133.                         {# CARD #}
  134.                         {% if use_card == enum('CartEnum::YES') %}
  135.                             <a class="tema--box-hover payment-method {{ classActive }}" href="#card" type="{{ enum('CartEnum::PAYMENT_CARD') }}">
  136.                                 <i>{{ ico('pagamento-cartao') }}</i>
  137.                                 <p class="subtit">
  138.                                     <span>{{ getLanguage('credit_card', 'cart') }}</span>
  139.                                     <span>{{ getLanguage('card', 'cart') }}</span>
  140.                                 </p>
  141.                                 <i class="check">{{ ico('check-payment') }}</i>
  142.                                 <i class="disabled">{{ ico('disabled') }}</i>
  143.                             </a>
  144.                             {% set classActive = '' %}
  145.                         {% endif %}
  146.                         {# PIX #}
  147.                         {% if use_pix == enum('CartEnum::YES') %}
  148.                             <a class="tema--box-hover payment-method {{ classActive }}" href="#pix" type="{{ enum('CartEnum::PAYMENT_PIX') }}"
  149.                             data-tooltip-text="{{ getLanguage('must_be_brazilian', 'cart') }}" data-tooltip-class="tooltip-base" data-tooltip-active="">
  150.                                 <i>{{ ico('pix') }}</i>
  151.                                 <p class="subtit">Pix</p>
  152.                                 <i class="check">{{ ico('check-payment') }}</i>
  153.                                 <i class="disabled">{{ ico('disabled') }}</i>
  154.                             </a>
  155.                             {% set classActive = '' %}
  156.                         {% endif %}
  157.                         {# BOLETO #}
  158.                         {% if use_bill == enum('CartEnum::YES') %}
  159.                             <a class="tema--box-hover payment-method {{ classActive }}" href="#bill" type="{{ enum('CartEnum::PAYMENT_BILL') }}"
  160.                             data-tooltip-text="{{ getLanguage('must_be_brazilian', 'cart') }}" data-tooltip-class="tooltip-base" data-tooltip-active="">
  161.                                 <i>{{ ico('barcode') }}</i>
  162.                                 <p class="subtit">{{ getLanguage('bill', 'cart') }}</p>
  163.                                 <i class="check">{{ ico('check-payment') }}</i>
  164.                                 <i class="disabled">{{ ico('disabled') }}</i>
  165.                             </a>
  166.                             {% set classActive = '' %}
  167.                         {% endif %}
  168.                     {% endif %}
  169.                     {# PAYPAL #}
  170.                     {% if showPayPal %}
  171.                         <a class="tema--box-hover payment-method {{ classActive }}" href="#paypal" url="{{ path('cartCheckoutPaypal') }}" type="{{ enum('CartEnum::PAYMENT_PAYPAL') }}">
  172.                             <i>{{ ico('paypal') }}</i>
  173.                             <p class="subtit">Paypal</p>
  174.                             <i class="check">{{ ico('check-payment') }}</i>
  175.                         </a>
  176.                         {% set classActive = '' %}
  177.                     {% endif %}
  178.                     {# PAGSEGURO #}
  179.                     {% if showPagSeguro %}
  180.                         <a class="tema--box-hover payment-method {{ classActive }}" href="#pagseguro" url="{{ path('cartCheckoutPagseguro') }}" type="{{ enum('CartEnum::PAYMENT_PAGSEGURO') }}">
  181.                             <i>{{ ico('pagseguro') }}</i>
  182.                             <p class="subtit">PagSeguro</p>
  183.                             <i class="check">{{ ico('check-payment') }}</i>
  184.                         </a>
  185.                         {% set classActive = '' %}
  186.                     {% endif %}
  187.                     {# MERCADO PAGO #}
  188.                     {% if showMercadoPago %}
  189.                         <a class="tema--box-hover payment-method {{ classActive }}" href="#mercadopago" url="{{ path('cartCheckoutMercadopago') }}" type="{{ enum('CartEnum::PAYMENT_MERCADOPAGO') }}">
  190.                             <i>{{ ico('mercado-pago') }}</i>
  191.                             <p class="subtit">Mercado Pago</p>
  192.                             <i class="check">{{ ico('check-payment') }}</i>
  193.                         </a>
  194.                         {% set classActive = '' %}
  195.                     {% endif %}
  196.                 </div>
  197.                 {# RECEBEDOR EAD #}
  198.                 {% if receiverSchoolEad %}
  199.                     {# CARD #}
  200.                     {% if use_card == enum('CartEnum::YES') %}
  201.                         {% include 'website/cart/cart-section-card.html.twig' with {payment: 'default'} %}
  202.                     {% endif %}
  203.                     {# PIX #}
  204.                     {% if use_pix == enum('CartEnum::YES') %}
  205.                         <div id="pix" class="payment-option pagamento-boleto div-method div-pix classHidden">
  206.                             <h3 class="title">Pix</h3>
  207.                             {# @!!!
  208.                             <div class="instructions">
  209.                                 <h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
  210.                                 <ul>
  211.                                     <li>Pix ({{ getLanguage('cash_only_payment', 'cart') }})</li>
  212.                                     <li>{{ getLanguage('payments_with_pix', 'cart') }}</li>
  213.                                     <li>{{ getLanguage('pay_attention_pix', 'cart') }}</li>
  214.                                     <li>{{ getLanguage('after_payment', 'cart') }}</li>
  215.                                 </ul>
  216.                             </div>
  217.                             #}
  218.                             <div class="bill-pix">
  219.                                 <div class="col">
  220.                                     <span class="ico">{{ ico('check-2') }}</span>
  221.                                     <span class="txt">{{ getLanguage('payments_with_pix', 'cart') }}</span>
  222.                                 </div>
  223.                                 <div class="col">
  224.                                     <span class="ico">{{ ico('clock-fast') }}</span>
  225.                                     <span class="txt">{{ getLanguage('txt_info_pix_pay', 'cart') }}</span>
  226.                                 </div>
  227.                                 <div class="col">
  228.                                     <span class="ico">{{ ico('envelope') }}</span>
  229.                                     <span class="txt">{{ getLanguage('txt_info_confirm_order', 'cart') }}</span>
  230.                                 </div>
  231.                             </div>
  232.                         </div>
  233.                     {% endif %}
  234.                     {# BILL #}
  235.                     {% if use_bill == enum('CartEnum::YES') %}
  236.                         <div id="bill" class="payment-option pagamento-boleto div-method div-bill classHidden">
  237.                             <h3 class="title">{{ getLanguage('bill', 'cart') }}</h3>
  238.                             {# @!!!
  239.                             <div class="instructions">
  240.                                 <h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
  241.                                 <ul>
  242.                                     <li>
  243.                                         {{ getLanguage('bill', 'cart') }} ({{ getLanguage('cash_only_payment', 'cart') }})
  244.                                     </li>
  245.                                     <li>{{ getLanguage('payments_with_bill', 'cart') }}</li>
  246.                                     <li>{{ getLanguage('pay_attention_bill', 'cart') }}</li>
  247.                                     <li>{{ getLanguage('after_payment', 'cart') }}</li>
  248.                                 </ul>
  249.                             </div>
  250.                             #}
  251.                             <div class="bill-pix">
  252.                                 <div class="col">
  253.                                     <span class="ico">{{ ico('clock-cycle') }}</span>
  254.                                     <span class="txt">{{ getLanguage('payments_with_bill', 'cart') }}</span>
  255.                                 </div>
  256.                                 <div class="col">
  257.                                     <span class="ico">{{ ico('clock-fast') }}</span>
  258.                                     <span class="txt">{{ getLanguage('pay_attention_bill', 'cart') }}</span>
  259.                                 </div>
  260.                                 <div class="col">
  261.                                     <span class="ico">{{ ico('envelope') }}</span>
  262.                                     <span class="txt">{{ getLanguage('txt_info_confirm_order', 'cart') }}</span>
  263.                                 </div>
  264.                                 {% if use_pix == enum('CartEnum::YES') %}
  265.                                     <div class="pix-info">
  266.                                         <span class="ico">{{ ico('pix') }}</span>
  267.                                         <div class="wrapper_info">
  268.                                             <span class="title">{{ getLanguage('txt_info_use_pix', 'cart') }}</span>
  269.                                             <span class="info">{{ getLanguage('txt_info_pix_access', 'cart') }}</span>
  270.                                             <label id="click-change-pix" class="click-here">{{ getLanguage('click_here_change', 'cart') }}</label>
  271.                                         </div>
  272.                                     </div>
  273.                                 {% endif %}
  274.                             </div>
  275.                         </div>
  276.                     {% endif %}
  277.                 {% endif %}{# -/ RECEBEDOR EAD #}
  278.                 {# PAYPAL #}
  279.                 {% if showPayPal %}
  280.                     <div id="paypal" class="payment-option pagamento-boleto div-method div-paypal classHidden">
  281.                         <h3 class="title">PayPal</h3>
  282.                         <div class="instructions">
  283.                             <h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
  284.                             <ul>
  285.                                 <li>{{ getLanguage('click_button_paypal', 'cart') }}</li>
  286.                                 <li>{{ getLanguage('paypal_accepts', 'cart') }}</li>
  287.                                 <li>{{ getLanguage('after_payment', 'cart') }}</li>
  288.                             </ul>
  289.                         </div>
  290.                     </div>
  291.                 {% endif %}
  292.                 {# PAGSEGURO #}
  293.                 {% if showPagSeguro %}
  294.                     <div id="pagseguro" class="payment-option pagamento-boleto div-method div-pagseguro classHidden">
  295.                         <h3 class="title">PagSeguro</h3>
  296.                         <div class="instructions">
  297.                             <h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
  298.                             <ul>
  299.                                 <li>{{ getLanguage('click_button_pagseguro', 'cart') }}</li>
  300.                                 <li>{{ getLanguage('pagseguro_accepts', 'cart') }}</li>
  301.                                 <li>{{ getLanguage('after_payment', 'cart') }}</li>
  302.                             </ul>
  303.                         </div>
  304.                     </div>
  305.                 {% endif %}
  306.                 {# MERCADO PAGO #}
  307.                 {% if showMercadoPago %}
  308.                     <div id="mercadopago" class="payment-option pagamento-boleto div-method div-mercadopago classHidden">
  309.                         <h3 class="title">Mercado Pago</h3>
  310.                         <div class="instructions">
  311.                             <h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
  312.                             <ul>
  313.                                 <li>{{ getLanguage('click_button_mercadopago', 'cart') }}</li>
  314.                                 <li>{{ getLanguage('mercadopago_accepts', 'cart') }}</li>
  315.                                 <li>{{ getLanguage('after_payment', 'cart') }}</li>
  316.                             </ul>
  317.                         </div>
  318.                     </div>
  319.                 {% endif %}
  320.             {% else %}
  321.                 {{ getLanguage('no_receiver', 'cart') }}
  322.             {% endif %}
  323.         </div>
  324.     {% endif %}
  325.     {# -/ VÁRIOS MÉTODOS #}
  326.     {% if receiverSchoolEad or showPayPal or showPagSeguro or showMercadoPago %}
  327.         <div class="base-acoes">
  328.             <button type="button" class="btn-confirmar btn-checkout btn-load">
  329.                 <span>{{ getLanguage('finish', 'cart') }}</span>
  330.                 <span>
  331.                     {{ getLanguage('wait', 'util') }}&thinsp;&hellip;&emsp;
  332.                     <i class="loader">{{ ico('loader-wish') }}</i>
  333.                 </span>
  334.             </button>
  335.         </div>
  336.     {% endif %}
  337. </div>