在WooCommerce中,我将在结帐帐单字段部分的末尾添加一个自定义帐单字段,并使用以下代码:
add_filter('woocommerce_checkout_fields', 'custom_woocommerce_billing_fields');
function custom_woocommerce_billing_fields($fields)
{
$fields['billing']['billing_options'] = array(
'label' => __('תאריך לידה', 'woocommerce'), // Add custom field label
'placeholder' => _x('תאריך לידה'), // Add custom field placeholder
'required' => true, // if field is required or not
'clear' => false, // add clear or not
'type' => 'date', // add field type
'class' => array('my-css') // add class name
);
return $fields;
}
如何在姓氏字段后或公司字段后添加此字段?