Last active
September 18, 2019 21:07
-
-
Save beamkiller/e22010b5b24201286a609f6302db9ba2 to your computer and use it in GitHub Desktop.
Checkout Check
This file contains hidden or 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
/** | |
* Process the checkout | |
**/ | |
add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process'); | |
function my_custom_checkout_field_process() { | |
global $woocommerce; | |
if ( ! (preg_match('/^[+]{0,1}[0-9]{10,14}$/D', $_POST['billing_phone'] ) ) ){ | |
wc_add_notice( "<strong>Telefón</strong> musí obsahovať minimálne 10 čísiel." ,'error' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment