Site logo

[Resolved] Remove address fields in checkout

Home Forums Support [Resolved] Remove address fields in checkout

Home Forums Support Remove address fields in checkout

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2576015
    Aaron

    EDIT, updated code and it is working now:

    I see a setting in Customizer to remove the 2nd address field, but we don’t need the address at all as all products are virtual. However the standard filter to remove these is not working.:

    add_filter(‘woocommerce_billing_fields’,’fs_custom_billing_fields’);
    // remove some fields from billing form

    function fs_custom_billing_fields( $fields = array() ) {

    unset($fields[‘billing_company’]);
    unset($fields[‘billing_address_1’]);
    unset($fields[‘billing_address_2’]);
    unset($fields[‘billing_state’]);
    unset($fields[‘billing_city’]);
    unset($fields[‘billing_phone’]);
    unset($fields[‘billing_postcode’]);
    unset($fields[‘billing_country’]);

    return $fields;
    }

    #2576227
    Fernando
    Customer Support

    Hi Aaron,

    I see. Glad you resolved the issue!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.