<?php
    if ($this->config->get('wg24_seo_fer_facebook_status')=='enable'){
        if (!$this->config->get('wg24_seo_fer_facebook_pixel')==''){
            echo html_entity_decode("<script>window.waitEvent('scripts_document', function() {
 fbq('track', 'AddPaymentInfo'); });</script>", ENT_QUOTES, 'UTF-8');
        }
    }
?>
<div class="one-page-checkout" id="checkoutSteps">
  <div id="opc-billing" class="section allow active custom_login_input_box">
    <div id="checkout-step-billing">

      <?php if ($error_warning) { ?>
        <div class="warning"><?php echo $error_warning; ?></div>
      <?php } ?>
      <?php if ($payment_methods) { ?>
        <?php foreach ($payment_methods as $payment_method) { ?>
          <?php if (isset($payment_method['quote'])) { ?>
            <?php foreach ($payment_method['quote'] as $key => $quote) { ?>
              <label class="radio radio-small">
                  <input
                    class="radio-entry"
                    type="radio"
                    name="payment_method"
                    data-code-type="<?php echo $key; ?>"
                    value="<?php echo $quote['code']; ?>"
                    id="<?php echo $quote['code']; ?>"
                    <?php echo (isset($quote['selected'])) ? 'checked' : ''; ?>
                  >
                <span class="radio-text"><?php echo $quote['title']; ?></span>
              </label>
            <?php } ?>
          <?php } else { ?>
            <?php $code_type = (isset($payment_method['code_type'])) ? $payment_method['code_type'] : false; ?>
            <label class="radio radio-small">
                <input
                  class="radio-entry"
                  type="radio"
                  name="payment_method" <?php echo ($code_type) ? 'data-code-type="'.$code_type.'"' : '' ;?>
                  value="<?php echo $payment_method['code']; ?>"
                  id="<?php echo $payment_method['code']; ?>"
                  <?php echo (isset($payment_method['selected'])) ? 'checked' : ''; ?>
                >
              <span class="radio-text"><?php echo $payment_method['title']; ?></span>
            </label>
          <?php } ?>
        <?php } ?>
      <?php } ?>
      <label class="field field-medium top-margin-large">
        <span class="field-label"><?php echo $text_comments; ?></span>
        <textarea class="field-entry" name="comment" rows="5" maxlength="1000"><?php echo $comment; ?></textarea>
      </label>


      <div class="row bottom-xs">

        <div class="col-xs-12 col-md">

          <?php if($feedback_order_status){ ?>
          <label class="checkbox checkbox-large">
            <input class="checkbox-entry js-feedback-entry" type="checkbox" name="feedback_order" value="1">
            <span class="checkbox-text"><?php echo $text_feedback_order_status; ?></span>
          </label>

          <label class="field field-medium left-margin-large hidden js-feedback-cellphone" style="max-width: 160px;">
            <span class="field-label"><?php echo $text_whatsapp_number; ?></span>
            <input type="tel" class="field-entry mask-celular" name="feedback_order_whatsapp" value="<?php echo $customer_celular; ?>">
          </label>
          <?php } ?>

          <?php if ($text_agree) { ?>
            <label class="checkbox checkbox-large">
              <input class="checkbox-entry" type="checkbox" name="agree" value="1" <?php echo ($agree) ? 'checked' : ''; ?>>
              <span class="checkbox-text"><?php echo $text_agree ?></span>
            </label>
          <?php } ?>
        </div>

        <div class="col-xs-12 col-md">
          <div class="content-box flex end-xs top-margin-large">
            <button type="button" id="button-payment-method" class="btn-default btn-large">
              <span><?php echo $button_continue; ?></span>
            </button>
          </div>
        </div>

      </div>

    </div>
  </div>
</div>

<script type="text/javascript">
  window.waitEvent('scripts_document', function() {
    $('.colorbox').fancybox({
      width: 640,
      height: 480
    });

    window.toggleClass(
      document.querySelector('.js-feedback-entry'),
      document.querySelector('.js-feedback-cellphone'),
      'hidden'
    );

  });
</script>
