Add additional fields to Admin User under Customer shipping section in Woocommerce

那年仲夏 提交于 2019-12-01 14:22:39

If you want to include your custom "Shipping phone" field in Backend User profile under "Customer's shipping address" section, you will use the following instead:

add_filter( 'woocommerce_customer_meta_fields', 'filter_add_customer_meta_fields', 10, 1 );
function filter_add_customer_meta_fields( $args ) {
    $args['shipping']['fields']['shipping_phone'] = array(
        'label'       => __( 'Shipping phone', 'woocommerce' ),
        'description' => '',
    );
    return $args;
}

Code goes in function.php file of your active child theme (or active theme). Tested and works.

This little code snippet will do it all. If you change the value in this "Shipping phone" field, it will be updated without needing any additional code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!