{% from 'utils.html.twig' import moeda, ico, paymentConditions, imgUpload %}
{# SHOW > PAYPAL | PAGSEGURO | MERCADO PAGO #}
{% set showPayPal = (receiverSchoolPayPal and hasOnlyCourseInCart and use_paypal) %}
{% set showPagSeguro = (receiverSchoolPagSeguro and hasOnlyCourseInCart and use_pagseguro) %}
{% set showMercadoPago = (receiverSchoolMercadoPago and hasOnlyCourseInCart and use_mercadopago) %}
<div class="parcelamento payment-config default" url="{{ urlPost }}" conclusion="{{ urlConclusion }}" data-status="loading">
<div id="paymentsLoader" class="tab-loader">
<i class="loader">{{ ico('loader-wish') }}</i>
<span>{{ getLanguage('wait', 'util') }} …</span>
</div>
{% set amountDisabled = 0 %}
<div id="checkout-list-default" class="checkout-list">
{% for cart in carts %}
{% if cart.able == enum('CartEnum::NO') %}
{% set amountDisabled = amountDisabled + cart.price %}
{% endif %}
<div class="item {{ cart.able == enum('CartEnum::NO') ? 'draft-item' }}" data-price="{{ cart.price }}" data-cart-id="{{ cart.id }}">
<div class="capa">
{{
imgUpload(
cart.productOffer.productPage.photo,
enum('AbstractEnum::PATH_PRODUCT_PHOTO'),
'product-photo',
cart.product.title
)
}}
</div>
<h4 item-title>{{ cart.product.title }}</h4>
<div class="price">
{% if cart.productOffer.priceDisplay > cart.price %}
<small class="price-original">
{{ getLanguage('of', 'cart') }} <s>{{ cart.productOffer.currencySymbol }} {{ cart.productOffer.priceDisplay|number_format(2, ',', '.') }}</s> {{ getLanguage('by', 'cart') }}
</small>
{% endif %}
{% set infoCycle = installmentPeriodText(cart.productOffer.planCycle) %}
{% set infoParcel = getOfferParcelInfo(cart.productOffer, cart) %}
<p class="price-offer">
{% if infoParcel.maxInstallments > 1 %}
{{ infoParcel.maxInstallments }}x {{ cart.productOffer.currencySymbol }} {{ infoParcel.parcelPrice|number_format(2, ',', '.') }}
{% else %}
{{ cart.productOffer.currencySymbol }} {{ cart.price|number_format(2, ',', '.') }}
{% if cart.productOffer.product.type == enum('ProductEnum::SUBSCRIPTION') or cart.productOffer.allowRecurrency == enum('ProductOfferEnum::YES') %}
/{{ infoCycle.text }}
{% endif %}
{% endif %}
</p>
{% if infoParcel.maxInstallments > 1 %}
<p class="preco-atual">
{{ getLanguage('or', 'cart') }}
<small>
{{ cart.productOffer.currencySymbol }} {{ cart.price|number_format(2, ',', '.') }}
{% if cart.productOffer.product.type == enum('ProductEnum::SUBSCRIPTION') or cart.productOffer.allowRecurrency == enum('ProductOfferEnum::YES') %}
/{{ infoCycle.text }}
{% endif %}
</small>
</p>
{% endif %}
{# MEMBERSHIP FEE #}
{% if cart.membershipFee > 0 %}
{% if cart.productCoupon and cart.productCoupon.applyMembershipFee == enum('ProductCouponEnum::YES') and isModuleActive('product_coupon_module')
and cart.productCoupon is not empty %}
<del class="price-membership">+ {{ getLanguage('membership_fee_of', 'cart') }} {{ cart.productOffer.currencySymbol }} {{ cart.membershipFee|number_format(2, ',', '.') }}</del>
{% else %}
<p class="price-membership">+ {{ getLanguage('membership_fee_of', 'cart') }} {{ cart.productOffer.currencySymbol }} {{ cart.membershipFee|number_format(2, ',', '.') }}</p>
{% endif %}
{% endif %}
</div>
{% if isCart %}
<button type="button" class="js--btn-item-event-default"
data-tooltip-text="{{ getLanguage('remove_purchase_item', 'cart') }}"
data-tooltip-class="tooltip-cart"
data-tooltip-position="bottom">
<i class="delete">{{ ico('delete') }}</i>
<i class="add">{{ ico('add') }}</i>
</button>
{% endif %}
</div>
{% endfor %}
</div>
{# MÉTODO ÚNICO #}
{% if isOneMethod == enum('CartEnum::YES') and (isOneMethodType != enum('CartEnum::PAYMENT_CARD') or (not showPayPal and not showPagSeguro and not showMercadoPago)) %}
<div id="payment-method-unique" class="parcelamento payment-method active" type="{{ isOneMethodType }}">
<section class="produto total">
<div class="campo">
<span>{{ getLanguage('you_pay_with', 'cart') }}</span>
<span class="show-payment-methods">
{% if isOneMethodType == enum('CartEnum::PAYMENT_CARD') %}
{{ getLanguage('card', 'cart') }}
{% elseif isOneMethodType == enum('CartEnum::PAYMENT_BILL') %}
{{ getLanguage('bill', 'cart') }}
{% elseif isOneMethodType == enum('CartEnum::PAYMENT_PIX') %}
Pix
{% endif %}
</span>
</div>
{% if cartSubtotalDiff > 0 %}
<div class="campo">
<span>{{ getLanguage('without_discount', 'cart') }}</span>
<span>{{ getConfig('currency_symbol') }} {{ cartDisplaySubtotal|number_format(2, ',', '.') }}</span>
</div>
<div class="campo">
<span>{{ getLanguage('total_discount', 'cart') }}</span>
<span>-{{ getConfig('currency_symbol') }} {{ cartSubtotalDiff|number_format(2, ',', '.') }}</span>
</div>
{% endif %}
<div class="soma">TOTAL {{ getConfig('currency_symbol') }} <b class="show-items-default-total-discount" data-value="{{ cartSubtotal - amountDisabled}}">{{ cartSubtotal|number_format(2, ',', '.') }}</b></div>
</section>
{% if use_card == enum('CartEnum::YES') and isOneMethodType == enum('CartEnum::PAYMENT_CARD') %}
<div id="js--payment-container" class="box-checkout box-checkout-form">
{% include 'website/cart/cart-section-card.html.twig' with {payment: 'default'} %}
</div>
{% endif %}
</div>
{# VÁRIOS MÉTODOS #}
{% else %}
<div id="js--payment-container" class="box-checkout box-checkout-form">
<div class="titulo-form">
<div class="col-1">
<h2>{{ getLanguage('payment_data', 'cart') }}</h2>
<p class="subtit">{{ getLanguage('select_a_payment_method', 'cart') }}</p>
</div>
<p class="titulo-total">
TOTAL {{ getConfig('currency_symbol') }} <b class="show-items-default-total-discount" data-value="{{ cartSubtotal }}">{{ cartSubtotal|number_format(2, ',', '.') }}</b>
</p>
</div>
{# SELECIONE PAGAMENTO #}
{% if receiverSchoolEad or showPayPal or showPagSeguro or showMercadoPago %}
{# PAYMENT METHODS TABS #}
<div class="metodos-pagamento">
{% set classActive = 'tema--box-hover-selected active' %}
{# TEM RECEBEDOR #}
{% if receiverSchoolEad %}
{# CARD #}
{% if use_card == enum('CartEnum::YES') %}
<a class="tema--box-hover payment-method {{ classActive }}" href="#card" type="{{ enum('CartEnum::PAYMENT_CARD') }}">
<i>{{ ico('pagamento-cartao') }}</i>
<p class="subtit">
<span>{{ getLanguage('credit_card', 'cart') }}</span>
<span>{{ getLanguage('card', 'cart') }}</span>
</p>
<i class="check">{{ ico('check-payment') }}</i>
<i class="disabled">{{ ico('disabled') }}</i>
</a>
{% set classActive = '' %}
{% endif %}
{# PIX #}
{% if use_pix == enum('CartEnum::YES') %}
<a class="tema--box-hover payment-method {{ classActive }}" href="#pix" type="{{ enum('CartEnum::PAYMENT_PIX') }}"
data-tooltip-text="{{ getLanguage('must_be_brazilian', 'cart') }}" data-tooltip-class="tooltip-base" data-tooltip-active="">
<i>{{ ico('pix') }}</i>
<p class="subtit">Pix</p>
<i class="check">{{ ico('check-payment') }}</i>
<i class="disabled">{{ ico('disabled') }}</i>
</a>
{% set classActive = '' %}
{% endif %}
{# BOLETO #}
{% if use_bill == enum('CartEnum::YES') %}
<a class="tema--box-hover payment-method {{ classActive }}" href="#bill" type="{{ enum('CartEnum::PAYMENT_BILL') }}"
data-tooltip-text="{{ getLanguage('must_be_brazilian', 'cart') }}" data-tooltip-class="tooltip-base" data-tooltip-active="">
<i>{{ ico('barcode') }}</i>
<p class="subtit">{{ getLanguage('bill', 'cart') }}</p>
<i class="check">{{ ico('check-payment') }}</i>
<i class="disabled">{{ ico('disabled') }}</i>
</a>
{% set classActive = '' %}
{% endif %}
{% endif %}
{# PAYPAL #}
{% if showPayPal %}
<a class="tema--box-hover payment-method {{ classActive }}" href="#paypal" url="{{ path('cartCheckoutPaypal') }}" type="{{ enum('CartEnum::PAYMENT_PAYPAL') }}">
<i>{{ ico('paypal') }}</i>
<p class="subtit">Paypal</p>
<i class="check">{{ ico('check-payment') }}</i>
</a>
{% set classActive = '' %}
{% endif %}
{# PAGSEGURO #}
{% if showPagSeguro %}
<a class="tema--box-hover payment-method {{ classActive }}" href="#pagseguro" url="{{ path('cartCheckoutPagseguro') }}" type="{{ enum('CartEnum::PAYMENT_PAGSEGURO') }}">
<i>{{ ico('pagseguro') }}</i>
<p class="subtit">PagSeguro</p>
<i class="check">{{ ico('check-payment') }}</i>
</a>
{% set classActive = '' %}
{% endif %}
{# MERCADO PAGO #}
{% if showMercadoPago %}
<a class="tema--box-hover payment-method {{ classActive }}" href="#mercadopago" url="{{ path('cartCheckoutMercadopago') }}" type="{{ enum('CartEnum::PAYMENT_MERCADOPAGO') }}">
<i>{{ ico('mercado-pago') }}</i>
<p class="subtit">Mercado Pago</p>
<i class="check">{{ ico('check-payment') }}</i>
</a>
{% set classActive = '' %}
{% endif %}
</div>
{# RECEBEDOR EAD #}
{% if receiverSchoolEad %}
{# CARD #}
{% if use_card == enum('CartEnum::YES') %}
{% include 'website/cart/cart-section-card.html.twig' with {payment: 'default'} %}
{% endif %}
{# PIX #}
{% if use_pix == enum('CartEnum::YES') %}
<div id="pix" class="payment-option pagamento-boleto div-method div-pix classHidden">
<h3 class="title">Pix</h3>
{# @!!!
<div class="instructions">
<h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
<ul>
<li>Pix ({{ getLanguage('cash_only_payment', 'cart') }})</li>
<li>{{ getLanguage('payments_with_pix', 'cart') }}</li>
<li>{{ getLanguage('pay_attention_pix', 'cart') }}</li>
<li>{{ getLanguage('after_payment', 'cart') }}</li>
</ul>
</div>
#}
<div class="bill-pix">
<div class="col">
<span class="ico">{{ ico('check-2') }}</span>
<span class="txt">{{ getLanguage('payments_with_pix', 'cart') }}</span>
</div>
<div class="col">
<span class="ico">{{ ico('clock-fast') }}</span>
<span class="txt">{{ getLanguage('txt_info_pix_pay', 'cart') }}</span>
</div>
<div class="col">
<span class="ico">{{ ico('envelope') }}</span>
<span class="txt">{{ getLanguage('txt_info_confirm_order', 'cart') }}</span>
</div>
</div>
</div>
{% endif %}
{# BILL #}
{% if use_bill == enum('CartEnum::YES') %}
<div id="bill" class="payment-option pagamento-boleto div-method div-bill classHidden">
<h3 class="title">{{ getLanguage('bill', 'cart') }}</h3>
{# @!!!
<div class="instructions">
<h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
<ul>
<li>
{{ getLanguage('bill', 'cart') }} ({{ getLanguage('cash_only_payment', 'cart') }})
</li>
<li>{{ getLanguage('payments_with_bill', 'cart') }}</li>
<li>{{ getLanguage('pay_attention_bill', 'cart') }}</li>
<li>{{ getLanguage('after_payment', 'cart') }}</li>
</ul>
</div>
#}
<div class="bill-pix">
<div class="col">
<span class="ico">{{ ico('clock-cycle') }}</span>
<span class="txt">{{ getLanguage('payments_with_bill', 'cart') }}</span>
</div>
<div class="col">
<span class="ico">{{ ico('clock-fast') }}</span>
<span class="txt">{{ getLanguage('pay_attention_bill', 'cart') }}</span>
</div>
<div class="col">
<span class="ico">{{ ico('envelope') }}</span>
<span class="txt">{{ getLanguage('txt_info_confirm_order', 'cart') }}</span>
</div>
{% if use_pix == enum('CartEnum::YES') %}
<div class="pix-info">
<span class="ico">{{ ico('pix') }}</span>
<div class="wrapper_info">
<span class="title">{{ getLanguage('txt_info_use_pix', 'cart') }}</span>
<span class="info">{{ getLanguage('txt_info_pix_access', 'cart') }}</span>
<label id="click-change-pix" class="click-here">{{ getLanguage('click_here_change', 'cart') }}</label>
</div>
</div>
{% endif %}
</div>
</div>
{% endif %}
{% endif %}{# -/ RECEBEDOR EAD #}
{# PAYPAL #}
{% if showPayPal %}
<div id="paypal" class="payment-option pagamento-boleto div-method div-paypal classHidden">
<h3 class="title">PayPal</h3>
<div class="instructions">
<h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
<ul>
<li>{{ getLanguage('click_button_paypal', 'cart') }}</li>
<li>{{ getLanguage('paypal_accepts', 'cart') }}</li>
<li>{{ getLanguage('after_payment', 'cart') }}</li>
</ul>
</div>
</div>
{% endif %}
{# PAGSEGURO #}
{% if showPagSeguro %}
<div id="pagseguro" class="payment-option pagamento-boleto div-method div-pagseguro classHidden">
<h3 class="title">PagSeguro</h3>
<div class="instructions">
<h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
<ul>
<li>{{ getLanguage('click_button_pagseguro', 'cart') }}</li>
<li>{{ getLanguage('pagseguro_accepts', 'cart') }}</li>
<li>{{ getLanguage('after_payment', 'cart') }}</li>
</ul>
</div>
</div>
{% endif %}
{# MERCADO PAGO #}
{% if showMercadoPago %}
<div id="mercadopago" class="payment-option pagamento-boleto div-method div-mercadopago classHidden">
<h3 class="title">Mercado Pago</h3>
<div class="instructions">
<h4>{{ getLanguage('pay_attention_details', 'cart') }}</h4>
<ul>
<li>{{ getLanguage('click_button_mercadopago', 'cart') }}</li>
<li>{{ getLanguage('mercadopago_accepts', 'cart') }}</li>
<li>{{ getLanguage('after_payment', 'cart') }}</li>
</ul>
</div>
</div>
{% endif %}
{% else %}
{{ getLanguage('no_receiver', 'cart') }}
{% endif %}
</div>
{% endif %}
{# -/ VÁRIOS MÉTODOS #}
{% if receiverSchoolEad or showPayPal or showPagSeguro or showMercadoPago %}
<div class="base-acoes">
<button type="button" class="btn-confirmar btn-checkout btn-load">
<span>{{ getLanguage('finish', 'cart') }}</span>
<span>
{{ getLanguage('wait', 'util') }} … 
<i class="loader">{{ ico('loader-wish') }}</i>
</span>
</button>
</div>
{% endif %}
</div>