Hi,
I’m trying to achieve two things on my woocommerce site (https://terrestrea.com/):
- Make Phone compulsory
- Remove “Add note to order” option
I tried everything from setting it in the theme customisation page (please see screenshot attached), using the " Checkout Field Editor for WooCommerce" plugin, and adding php into functions.php for my child theme, but it does not seem to be making changes.
Wondering if you might know what the issue is, thanks - Ken.
code snippets added:
add_filter(‘woocommerce_checkout_fields’, ‘custom_billing_fields’, 1000, 1);
function custom_billing_fields( $fields ) {
$fields[‘billing’][‘billing_phone’][‘required’] = true;
return $fields;
}
add_filter( ‘woocommerce_enable_order_notes_field’, ‘__return_false’, 9999 );
Hi, today I I faced the same problem - Redirecting...
No matter what I do, the code that worked for woo checkout before does not work.
Have you solved the problem?
you messed up something with the code. My case
add_filter( 'woocommerce_default_address_fields', 'wc_unrequire_wc_phone_field');
function wc_unrequire_wc_phone_field( $fields ) {
$fields['address_2']['required'] = false;
$fields['address_1']['required'] = false;
$fields['country']['required'] = false;
return $fields;
}
1 Like
My code work. Its need to checkout page add classic checkout widget instead of new blocks checkout
Couldn’t get it to work! The support team said they could not recreate the problem so I’m not sure why it’s not working
Ah, I was thinking of keeping the new checkout because it looks neater, I was thinking the problem has something to do with that, just not sure how to fix it.