-
AuthorPosts
-
October 29, 2017 at 8:41 pm #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.
October 29, 2017 at 11:11 pm #870249Nobody?
October 30, 2017 at 6:35 am #870346Hi,
Do you want to just remove the asterisk or that the field is required?
Best regards,
Jordan ShannonOctober 30, 2017 at 10:18 am #870396Both but the required field should be taken care of by the code above.
October 31, 2017 at 5:08 am #870719Hi,
If possible, please provide a link to the page in question.
Best regards,
Jordan ShannonOctober 31, 2017 at 4:54 pm #870883The adress is in private content.
Thank you in advance.
October 31, 2017 at 5:08 pm #870889Hi,
Add the following to quick css:
#billing_phone_field .required font font{ display:none!important; }
Best regards,
Jordan ShannonOctober 31, 2017 at 5:17 pm #870892That didn`t work.
Maybe the problem here is the German Market Plugin for WooCommerce
October 31, 2017 at 5:28 pm #870898Hi,
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 ShannonOctober 31, 2017 at 5:55 pm #870912Nope, that doesn`t work.
Any other ideas?
November 1, 2017 at 11:57 am #871163Hi,
Please try this instead:
#billing_phone_field abbr.required { display:none !important; }
Best regards,
RikardNovember 1, 2017 at 12:38 pm #871181That worked!
Thank you very much!
November 1, 2017 at 1:01 pm #871189I was too fast.
WooCommerce still gets me an error that the telephone field is required although I pasted this code to the functions.phpadd_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; }
Any ideas?
November 1, 2017 at 9:33 pm #871381Hi,
I ran a test checkout and was able to continue without the number. Is it not allowing you to continue?
Best regards,
Jordan ShannonNovember 4, 2017 at 7:04 pm #872581Hi Jordan,
tried it in Chrome, FF and Edge. It isn
t working. I can
t 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.
November 5, 2017 at 12:49 pm #872739I tested it in all windows browsers (no safari). It just isn`t working.
@Jordon
Go all the way through. I will delete your order!November 5, 2017 at 1:19 pm #872745The error appears at the end.
November 5, 2017 at 2:07 pm #872750Hi,
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,
RikardNovember 5, 2017 at 3:12 pm #872754Awesome!
That seems to be working!November 5, 2017 at 11:34 pm #872857Hi,
Glad that Rikard helped you. Thanks for using Enfold :)
Best regards,
Nikko -
AuthorPosts
- The topic ‘Remove * at Telephone required in WooCommerce’ is closed to new replies.