• Resolved Paal Joachim Romdahl

    (@paaljoachim)


    Hi

    I am helping a non profit that sells organic food. Members pick up their order themselves, so that I have turned off freight but how do I also turn off Invoice details?
    As there is no need to include the address of the person ordering.

    There really should be some more alternatives when it comes to adjusting the fields in the cart. (actually the same goes for shop and product.)

    I have come across an unset to remove the various invoice fields but I am thinking there is likely also a better way of handling this.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Paal Joachim Romdahl

    (@paaljoachim)

    Hey

    Thanks!
    Yeah I came across the code and was wondering if one could use an action instead but have been told that because it is in an array that I have to use unset instead. I am then also using CSS to hide order details and additional information titles.

    Hi,

    I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Thread Starter Paal Joachim Romdahl

    (@paaljoachim)

    This is a tricky area. If one turns off shipping the billing address might show up anyway. So one has to use a plugin or code to hide/remove it.

    I have received some help with the code:

    // 
     function kia_modify_default_address_fields( $fields ){
         if( isset( $fields['country'] ) ) unset( $fields['country'] );
         if( isset( $fields['address_1'] ) ) unset( $fields['address_1'] );
         if( isset( $fields['address_2'] ) ) unset( $fields['address_2'] );
         if( isset( $fields['city'] ) ) unset( $fields['city'] );
         if( isset( $fields['state'] ) ) unset( $fields['state'] );
         if( isset( $fields['postcode'] ) ) unset( $fields['postcode'] );
         return $fields; 
     }
     add_filter( 'woocommerce_default_address_fields', 'kia_modify_default_address_fields' );
     
     function kia_remove_billing_phone_fields( $fields ){
         // if( isset( $fields['billing_phone'] ) ) unset( $fields['billing_phone'] );
         // if( isset( $fields['billing_email'] ) ) $fields['billing_email']['class'] = array( 'form-row-wide' );
         return $fields;
     
     }
     add_filter( 'woocommerce_billing_fields', 'kia_remove_billing_phone_fields' );
     
     // https://businessbloomer.com/woocommerce-remove-order-notes-checkout-page/
     // Removes the Additional Information box.
     add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to turn off invoice information in checkout?’ is closed to new replies.