【发布时间】:2019-07-22 11:59:55
【问题描述】:
您好,我使用下面的代码在结算表单中添加了自定义字段。
add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields');
function custom_woocommerce_billing_fields($fields)
{
$fields['billing_options'] = array(
'label' => __('If you pay by Invoice. Please add Your Invoice Number Here ', 'woocommerce'), // Add custom field label
'placeholder' => _x('Invoice Number', 'placeholder', 'woocommerce'), // Add custom field placeholder
'required' => false, // if field is required or not
'clear' => false, // add clear or not
'type' => 'text', // add field type
'class' => array('my-css') // add class name
);
return $fields;
}
我有两种付款方式 1. 货到付款 2.Realex Payments HPP – 信用卡。
是否可以只显示自定义字段 1. 选择货到付款作为付款方式。
谢谢
【问题讨论】:
标签: php jquery wordpress woocommerce checkout