Home / Admin / Set the Payment fields in the Sign Up form as required
Duplicate Snippet

Embed Snippet on Your Site

Set the Payment fields in the Sign Up form as required

Set the Payment fields in the Sign Up form as required - you can remove any of the add_filter('wcv_... lines if you don't want those fields to be required.

Code Preview
php
<?php
add_filter('wcv_vendor_paypal_address', 'wcv_set_payment_field_required');
add_filter('wcv_vendor_paypal_venmo', 'wcv_set_payment_field_required');
add_filter('wcv_vendor_bank_account_name', 'wcv_set_payment_field_required');
add_filter('wcv_vendor_bank_account_number', 'wcv_set_payment_field_required');
add_filter('wcv_vendor_bank_name', 'wcv_set_payment_field_required');
add_filter('wcv_vendor_bank_routing_number', 'wcv_set_payment_field_required');
add_filter('wcv_vendor_bank_bic_swift', 'wcv_set_payment_field_required');
/**
 * Add required attribute to payment fields
 *
 * @param array $payment_field The input field to modify.
 *
 * @return array $payment_field The modified input field.
 */
function wcv_set_payment_field_required( $payment_field )
{
    $payment_field['custom_attributes'] = array( 'required' => true );
    return $payment_field;
}

Comments

Add a Comment