This topic has 1 reply, 2 voices, and was last updated 7 years by Laura.

  • Author
  • #158961
     fabianno0572
    Participant

    Hello,

    I find that Billing Details of Woocommerce is making almost all of the fields compulsary.

    As my business is cash term and is providing personal service, I do provide cash term service. Most of my clients will make appointment with me via appointment plugin before they come to me.

    How can I make only a few fields in Billing Details compulsary?

    I need only :

    1. First Name

    2. Last Name

    3. Phone

    4. Email Address

    #159151
     Laura
    Moderator

    Hello, please try by adding this to functions.php of child theme found at wp-contents/themes at FTP or your hosting file manager 🙂

    COPY CODE
    
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
     
    function custom_override_checkout_fields( $fields ) {
        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_city']);
        return $fields;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?