<?php

/**
 * True/false input
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $wpcb_field;

$wpcb_field_id = wpcb_sanitize_title( $wpcb_field['id'] );

echo '<input id="' . esc_attr( $wpcb_field_id ) . '" type="checkbox" name="' . esc_attr( wpcb_sanitize_title( $wpcb_field['field']['label'] ) ) . '"';
echo esc_attr( isset( $wpcb_field['field']['checked'] ) && 'yes' === $wpcb_field['field']['checked'] ? 'checked' : '' );
echo esc_attr( isset( $wpcb_field['field']['class'] ) ? ' class="' . $wpcb_field['field']['class'] . '"' : '' );
echo esc_attr( isset( $wpcb_field['field']['key'] ) ? ' data-key="' . $wpcb_field['field']['key'] . '"' : '' );
echo esc_attr( 'yes' === $wpcb_field['field']['required'] ? ' required' : '' );
wpcb_display_field_attributes( $wpcb_field );
echo ' autocomplete="off" />';
?>
<div class="wpcb-input-switch"></div>
<div class="wpcb-input-field-details">
	<p class="wpcb-configurator-field-label wpcb-input-field-label"><?php echo esc_attr( $wpcb_field['field']['label'] ); ?></p>
	<?php if ( isset( $wpcb_field['field']['note'] ) ) : ?>
		<div class="wpcb-input-field-note"><?php echo wp_kses_post( $wpcb_field['field']['note'] ); ?></div>
	<?php endif; ?>
</div>
<div class="wpcb-input-field-totals">

	<?php if ( isset( $wpcb_field['field']['price'] ) && '' !== $wpcb_field['field']['price'] ) : ?>

		<p class="wpcb-input-field-price"><?php echo wp_kses_post( wpcb_get_price_html( $wpcb_field['field']['price'] ) ); ?></p>

	<?php endif; ?>

	<?php if ( isset( $wpcb_field['field']['description'] ) && '' !== $wpcb_field['field']['description'] ) : ?>

		<?php echo wpcb_display_description_button_html( $wpcb_field_settings ); ?>
		
	<?php endif; ?>

</div>