WooCommerce 自定义结帐字段问题

问题描述

使用 add_filter 添加自定义结帐字段,但我想让结帐页面如下所示:

enter image description here

将有两行,每行将有两列。我想在结帐页面的四个部分添加字段。

但是每当我在这样的另一个部分中使用 add_filter 时,其他部分的字段也会出现。有什么解决办法?

这是我尝试过的:

function custom_billing_field ( $fields )  {

     $fields['billing']['checkout_custom_field_1'] = array(
        'priority'   => 2,'label'     => __( 'Location','woocommerce' ),'placeholder'   => _x( 'Enter your location','placeholder','required'  => true,'clear'     => true,'type'      => 'text','class'     => array('')
         );
     return $fields;
}
add_filter( 'woocommerce_checkout_fields','custom_billing_field' );

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)