A Cozmoslabs Product
Documentation / Developer Knowledge Base / Make other Billing Fields required

Make other Billing Fields required

If you’re need to make the ZIP / Postal Code or the State / Province fields required in your form, you can do this with some custom code:

1
2
3
4
5
6
7
8
9
10
11
12
add_filter( 'pms_inv_get_invoice_fields', 'pmsc_require_billing_fields' );
function pmsc_require_billing_fields( $fields ){
 
    if( isset( $fields['pms_billing_state'] ) )
        $fields['pms_billing_state']['required'] = 1;
 
    if( isset( $fields['pms_billing_zip'] ) )
        $fields['pms_billing_zip']['required'] = 1;
 
    return $fields;
 
}

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket