Title: Woocommerce Address Fields
Last modified: December 4, 2019

---

# Woocommerce Address Fields

 *  [msdsl](https://wordpress.org/support/users/msdsl/)
 * (@msdsl)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/woocommerce-address-fields/)
 * I have a custom role (customer-service) for staff processing orders and managing
   users details, which has the user-edit permission enabled. However they cannot
   see everything on this page like the admin can.
 * I need them to be able to edit the users woocommerce addresses (billing and shipping
   addresses) but with no additional access to other woocommerce areas. I can’t 
   find a way to enable this using the plugin or searching through forums. Everything
   else is there except for these fields.
 * Could you tell me how this is possible please?

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

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/woocommerce-address-fields/#post-12215165)
 * By default WooCommerce shows billing/shipping address fields at user profile 
   for the user with ‘manage_woocommerce’ capability only. But WC developers allows
   to change this logic via custom filter ‘woocommerce_current_user_can_edit_customer_meta_fields’.
 *     ```
       public function add_customer_meta_fields( $user ) {
       if ( ! apply_filters( 'woocommerce_current_user_can_edit_customer_meta_fields', current_user_can( 'manage_woocommerce' ), $user->ID ) ) {
       	return;
       }
       ```
   
 * Use code below as a sample to show billing/shipping address fields to a user 
   with selected role. Replace ‘subadmin’ with a role of your choice.
 *     ```
       add_filter( 'woocommerce_current_user_can_edit_customer_meta_fields', 'edit_wc_customer_meta_fields_cap', 10, 1 );
   
       function edit_wc_customer_meta_fields_cap( $can_manage_woocommerce ) {
   
           if ( $can_manage_woocommerce ) {
               return $can_manage_woocommerce;
           }
   
           $user = wp_get_current_user();
           if ( in_array( 'subadmin', $user->roles ) ) {
               return true;
           }
   
           return false;
       }
       ```
   
    -  This reply was modified 6 years, 6 months ago by [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/).
      Reason: code sample was added
 *  Thread Starter [msdsl](https://wordpress.org/support/users/msdsl/)
 * (@msdsl)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/woocommerce-address-fields/#post-12249725)
 * Thank you very much Vladimir, that works perfectly 🙂

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

The topic ‘Woocommerce Address Fields’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [msdsl](https://wordpress.org/support/users/msdsl/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/woocommerce-address-fields/#post-12249725)
 * Status: not resolved