Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #870204

    Hey there,
    I want to remove the * at Telephone box in Woocommerce.

    I already inserted this code to the functipns.php:

    add_filter( ‚woocommerce_billing_fields‘, ‚wc_npr_filter_phone‘, 10, 1 );

    function wc_npr_filter_phone( $address_fields ) {
    $address_fields[‚billing_phone‘][‚required‘] = false;
    return $address_fields;
    }

    Thank you very much :)

    • This topic was modified 7 years ago by ibetubet.
    #870249

    Nobody?

    #870346

    Hi,

    Do you want to just remove the asterisk or that the field is required?

    Best regards,
    Jordan Shannon

    #870396

    Both but the required field should be taken care of by the code above.

    #870719

    Hi,

    If possible, please provide a link to the page in question.

    Best regards,
    Jordan Shannon

    #870883

    The adress is in private content.

    Thank you in advance.

    #870889

    Hi,

    Add the following to quick css:

    #billing_phone_field .required font font{
    display:none!important;
    }

    Best regards,
    Jordan Shannon

    #870892

    That didn`t work.

    Maybe the problem here is the German Market Plugin for WooCommerce

    #870898

    Hi,

    CSS is pretty universal so it should have worked. Do you have any other custom css that may be preventing that from running. Please try putting it at the very top of all your other css.

    Best regards,
    Jordan Shannon

    #870912

    Nope, that doesn`t work.

    Any other ideas?

    #871163

    Hi,

    Please try this instead:

    #billing_phone_field abbr.required {
      display:none !important;
    }

    Best regards,
    Rikard

    #871181

    That worked!

    Thank you very much!

    #871189

    I was too fast.
    WooCommerce still gets me an error that the telephone field is required although I pasted this code to the functions.php

    add_filter( ‚woocommerce_billing_fields‘, ‚wc_npr_filter_phone‘, 10, 1 );
    
    function wc_npr_filter_phone( $address_fields ) {
    $address_fields[‚billing_phone‘][‚required‘] = false;
    return $address_fields;
    }

    Telephone required

    Any ideas?

    #871381

    Hi,

    I ran a test checkout and was able to continue without the number. Is it not allowing you to continue?

    Best regards,
    Jordan Shannon

    #872581

    Hi Jordan,

    tried it in Chrome, FF and Edge. It isnt working. I cant continue without a phone number.

    In functions.php I inserted this code:

    add_filter( ‚woocommerce_billing_fields‘, ‚wc_npr_filter_phone‘, 10, 1 );
    
    function wc_npr_filter_phone( $address_fields ) {
    $address_fields[‚billing_phone‘][‚required‘] = false;
    return $address_fields;
    }

    and in the quick css field

    #billing_phone_field abbr.required {
      display:none !important;
    }

    I need help.

    #872739

    I tested it in all windows browsers (no safari). It just isn`t working.

    @Jordon
    Go all the way through. I will delete your order!

    #872745

    The error appears at the end.

    #872750

    Hi,

    Thanks for the feedback, where exactly did you find the initial code you sent? This:

    add_filter( ‚woocommerce_billing_fields‘, ‚wc_npr_filter_phone‘, 10, 1 );
    
    function wc_npr_filter_phone( $address_fields ) {
    $address_fields[‚billing_phone‘][‚required‘] = false;
    return $address_fields;
    }

    Why I’m asking is because it has characters which should not be there. Maybe this will work better?

    add_filter( 'woocommerce_billing_fields', 'wc_npr_filter_phone', 10, 1 );
    
    function wc_npr_filter_phone( $address_fields ) {
    $address_fields['billing_phone']['required'] = false;
    return $address_fields;
    }

    Best regards,
    Rikard

    #872754

    Awesome!
    That seems to be working!

    #872857

    Hi,

    Glad that Rikard helped you. Thanks for using Enfold :)

    Best regards,
    Nikko

Viewing 20 posts - 1 through 20 (of 20 total)
  • The topic ‘Remove * at Telephone required in WooCommerce’ is closed to new replies.