woocommerce remove additional information checkout

woocommerce remove additional information checkout is the way helping us remove unnecessary information on the checkout page. By default, the system has some required fields customers must fill in when carrying out the payment. However, depending on your purposes, you can add or delete fields properly. This article will help you solve the above problem.

If you are a woocommerce newbie, I suggest that you should study the document about it. The document which helps save much time in the future is quite detailed. Right now, we will go straight to the main point woocommerce remove additional information checkout.

woocommerce remove additional information checkout

In order to edit things in the front end of woocommerce, you can install plugin, or find code of woocommerce plugin to edit. However, the safest as well as the most effective way is that you insert code to function file.php. This way ensures that your plugin will not be edited, which facilitates update the system as well as the plugin.

Delete Company and Phone field.

In theme folder of your current website, you move to function.php file and copy the code below and paste in the final part of the file. You could view the comment in code to understand the purpose of each code.

functionwc_ht_remove_checkout_field( $fields) {
  unset( $fields['billing']['billing_company'] );  //  Removes the Company Field.
  unset( $fields['billing']['billing_phone'] );   //  Removes the Phone Field.
 return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'wc_ht_remove_checkout_field');

Remove ‘order notes’ from checkout

function wc_ht_remove_checkout_field( $fields) { 
unset($fields['order']['order_comments']); // remove order comment fields 
return$fields; }
add_filter( 'woocommerce_checkout_fields', 'wc_ht_remove_checkout_field');

Remove billing details from WooCommerce checkout

functionwc_ht_remove_checkout_field( $fields) {
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_city']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_country']);
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_phone']);
unset($fields['order']['order_comments']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_email']);
unset($fields['billing']['billing_city']);
return$fields;
}
add_filter( 'woocommerce_checkout_fields', 'wc_ht_remove_checkout_field');

Remove shipping fields from WooCommerce checkout

functionwc_ht_remove_checkout_field( $fields) {
// remove shipping fields
unset($fields['shipping']['shipping_first_name']);
unset($fields['shipping']['shipping_last_name']);
unset($fields['shipping']['shipping_company']);
unset($fields['shipping']['shipping_address_1']);
unset($fields['shipping']['shipping_address_2']);
unset($fields['shipping']['shipping_city']);
unset($fields['shipping']['shipping_postcode']);
unset($fields['shipping']['shipping_country']);
unset($fields['shipping']['shipping_state']);
return$fields;
}
add_filter( 'woocommerce_checkout_fields', 'wc_ht_remove_checkout_field');

 

Leave a Reply

Your email address will not be published. Required fields are marked *