How to Make Email Field Optional in WooCommerce Checkout in WordPress | No Required

How to Make Email Field Optional in WooCommerce Checkout in WordPress | No Required

WebTask With Hassan

54 года назад

849 Просмотров

In this woocommerce tutorial for beginners you will learn how to make email field option / not compulsory in billing form using custom php snippet in woocommerce checkout page in wordpress. So user / customer place order in checkout page without adding email address.

* Use this code to make optional email address field:

add_filter( 'woocommerce_billing_fields', 'ts_unrequire_wc_email_field');
function ts_unrequire_wc_email_field( $fields ) {
$fields['billing_email']['required'] = false;
return $fields;
}

#woocommerce #email #optional #field #required #checkout #billing #code #wordpress #webtaskwithhassan #hassangilani

Тэги:

#woocommerce #wordpress #WebTaskWithHassan #HassanGilani #checkout #field #billing #code #email #optional #required
Ссылки и html тэги не поддерживаются


Комментарии:

@wotevermajorlooser
@wotevermajorlooser - 24.05.2024 15:37

Thank you for making this video - but I'm getting an error: Cannot redeclare ts_unrequire_wc_email_field() (previously declared in /home2/omoomosa/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(292) : eval()'d code:2)

Ответить
@brianspringman8160
@brianspringman8160 - 02.08.2024 01:42

Snippet didn't work. Didn't create an error but it also did not make the email optional.

Ответить