i want to make checkbox by default as checked but i am using array format for checkbox which is given below. i am new to wordpress so don’t know much about parameters.
add_action( 'woocommerce_review_order_before_submit','bt_add_checkout_checkbox', 10 );
/**
* Add WooCommerce Checkbox checkout
*/
function bt_add_checkout_checkbox() {
woocommerce_form_field( 'checkout-checkbox', array( // CSS ID
'type' => 'checkbox',
'class' => array('form-row mycheckbox'), // CSS Class
'label_class' => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'),
'input_class' => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'),
'label' => 'Ok I agree with <a href="/checkout-checkbox" target="_blank" rel="noopener">Checkout Checkbox Page</a>', // Label and Link
));
}
this code is in function.php
so basically i want this checkbox as checked by defaul.