小编sol*_*tal的帖子

根据所选付款方式显示隐藏自定义 Woocommerce 结账字段

您好,我使用下面的代码在计费表单中添加了自定义字段。

\n\n
add_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}\n
Run Code Online (Sandbox Code Playgroud)\n\n

我有两种付款方式 1. 货到付款 2.Realex Payments …

php wordpress jquery checkout woocommerce

3
推荐指数
1
解决办法
4176
查看次数

标签 统计

checkout ×1

jquery ×1

php ×1

woocommerce ×1

wordpress ×1