Last active
January 16, 2016 14:29
-
-
Save bryan-snyder/ddb636d30e9bc004c6ba to your computer and use it in GitHub Desktop.
Remove this code to make field not required.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//remove this dumb shit and make PO field not required | |
//lol $pooorder | |
public function validate_fields () { | |
$poorder = $this->get_post( 'po_number_field' ); | |
if( ! $poorder ) { | |
if ( function_exists ( 'wc_add_notice' ) ) { | |
// Replace this old ass f'in $woocommerce_add_error() function. | |
wc_add_notice ( __ ( 'Please enter your PO Number.', 'woocommerce-gateway-purchase-order' ), 'error' ); | |
} else { | |
WC()->add_error( __( 'Please enter your PO Number.', 'woocommerce-gateway-purchase-order' ) ); | |
} | |
return false; | |
} else { | |
return true; | |
} | |
} // End the validation stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment