您好,我使用下面的代码在计费表单中添加了自定义字段。
\n\nadd_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields');\n\nfunction custom_woocommerce_billing_fields($fields)\n{\n\n $fields['billing_options'] = array(\n 'label' => __('If you pay by Invoice. Please add Your Invoice Number Here ', 'woocommerce'), // Add custom field label\n 'placeholder' => _x('Invoice Number', 'placeholder', 'woocommerce'), // Add custom field placeholder\n 'required' => false, // if field is required or not\n 'clear' => false, // add clear or not\n 'type' => 'text', // add field type\n 'class' => array('my-css') // add class name\n );\n\n return $fields;\n}\nRun Code Online (Sandbox Code Playgroud)\n\n我有两种付款方式 1. 货到付款 2.Realex Payments …