Hi,
Please refer below for the code.
To hide the checkbox that is shown on the checkout page, you will need to use a little code. The following code will go in your theme’s style.css file or in a custom plugin.
p#leave_at_door_checkbox_field {
display: none;
}
To make the field mandatory. The following code will go in your theme’s functions.php file or in a custom plugin.
add_action( 'woocommerce_after_checkout_validation', 'make_delivery_instructions_text_mandatory2', 9999, 2);
function make_delivery_instructions_text_mandatory2( $fields, $errors ){
// if any validation errors
if ( empty( $_POST['leave_at_door_instructions'] ) ) {
$errors->add( 'woocommerce_password_error', __( 'Please add note to the instruction' ) );
}
}
If this has helped you at all, I would encourage you to leave a review to help others find this plugin for their store. If you still need assistance, please let me know.
Cheers
-
This reply was modified 2 years, 5 months ago by
Marc.