• Resolved 5vvo8jvod6

    (@5vvo8jvod6)


    Hi for example I want to remove all fields in ‘bank transfer’ like this:

    add_filter( "adverts_form_load", function($form){
    
        if( $form['name'] !== "adverts-bank-transfer" ) {
            return $form;
        }
    
        //remove 'adverts_person'
        foreach( $form["field"] as $key => $field ) {
            if( in_array($field["name"], array( "adverts_person" ) ) ) {
                unset($form["field"][$key]);
            }
        }
    
        //remove 'adverts_email'
        foreach( $form["field"] as $key => $field ) {
            if( in_array($field["name"], array( "adverts_email" ) ) ) {
                unset($form["field"][$key]);
            }
        }
    
        return $form;
    
    } );

    It remove all fields. But it seems doesnt work, nothing happens after i click ‘place order’.

Viewing 1 replies (of 1 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    you should not remove these fields from the payment form, without them WPAdverts will not be able to save the payment object.

Viewing 1 replies (of 1 total)

The topic ‘Remove all fields for payment form’ is closed to new replies.