• Resolved omarltahaineh

    (@omarltahaineh)


    hello,
    I’m looking to remove the first and last names from the billing and the shipping address section in the my account page.
    I managed to do it in the checkout page using this code:

    /**
    Remove all possible fields
    **/

    function wc_remove_checkout_fields( $fields ) {

    // Billing fields
    unset( $fields[‘billing’][‘billing_first_name’] );
    unset( $fields[‘billing’][‘billing_last_name’] );

    // Shipping fields

    unset( $fields[‘shipping’][‘shipping_first_name’] );
    unset( $fields[‘shipping’][‘shipping_last_name’] );

    // Order fields
    unset( $fields[‘order’][‘order_comments’] );

    return $fields;
    }
    add_filter( ‘woocommerce_checkout_fields’, ‘wc_remove_checkout_fields’ );

    it works perfectly for the check out page, but the fields was not removed from the account page

Viewing 2 replies - 1 through 2 (of 2 total)
  • Margaret S. woo-hc

    (@margaretwporg)

    Hi @omarltahaineh

    Thanks for sharing the code you used on the checkout page.

    I came across this article that can provide you pointers about how to remove the first/last names from the billing and the shipping address section in the my account page: https://rudrastyh.com/woocommerce/billing-and-shipping-address-fields.html

    In case that doesn’t help, and as this is a development oriented topic, I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    This specific forum is more focused on the default WooCommerce core features.

    Lastly, for direct assistance with code customizations, I recommend consulting with the WooCommerce Customizations Partners. https://woocommerce.com/customizations/

    Margaret S. woo-hc

    (@margaretwporg)

    Seems we’ve not had additional inputs on this thread. Thus, we encourage you to make use of the above resources.

    I’ll go ahead and mark the thread as resolved but please feel free to create a new thread if you have further questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to remove the first and last names in the addresses tab in my account page’ is closed to new replies.