<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>

<script>
    jQuery(document).ready(function($) {
        if ($('#product-type').val() === 'simple') {
            $('#general_product_data').find('.pricing').show();
        } else {
            $('#general_product_data').find('.pricing').hide();
        }

        $('#general_product_data').find('.pricing').attr('class','wiaas_show_if_simple');

        $('body').on('woocommerce-product-type-change', function (event, select_val) {

            if ('simple' === select_val) {
                $('.wiaas_show_if_simple').show();
            } else {
                $('.wiaas_show_if_simple').hide();
            }

        });

    });
</script>

<?php
woocommerce_wp_checkbox(
	array(
		'id'          => '_wiaas_recurring_price',
		'value'       => $product_pricing['is_recurring'] ? 'yes' : 'no',
		'data_type'   => 'price',
		'label'       => __( 'Is recurring?', 'wiaas' ),
	)
);

woocommerce_wp_text_input(
	array(
		'id'        => '_wiaas_recurring_pay_period',
		'value'     => $product_pricing['pay_period'],
		'label'     => __( 'Pay period (Months)', 'wiaas' ),
		'type' => 'number',
	)
);
?>