• Hi,

    Is it possible to change so there is no tick box and the text field is mandatory to fill in?

    This plugin is the only plugin we could find that does what we need.

    Thanks in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter getyourmobi

    (@getyourmobi)

    I’ve styled it to hide the checkbox.

    Is there a php filter to make the text field required?

    Plugin Support Marc

    (@marcangel)

    Hi, you need to add customisation to achieve that.

    • This reply was modified 2 years, 6 months ago by Marc.
    Thread Starter getyourmobi

    (@getyourmobi)

    Hi Marc,

    Would you be able to provide the code or filters in order to achieve this?

    Thanks in advance.

    Plugin Support Marc

    (@marcangel)

    Hi, will get back on you regarding this.

    • This reply was modified 2 years, 6 months ago by Marc.
    • This reply was modified 2 years, 6 months ago by Marc.
    Plugin Support Marc

    (@marcangel)

    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.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Make all of it mandatory?’ is closed to new replies.