|
@@ 478-483 (lines=6) @@
|
| 475 |
|
$this->posted[ $key ] = wc_format_postcode( $this->posted[ $key ], $_POST[ $fieldset_key . '_country' ] ); |
| 476 |
|
endif; |
| 477 |
|
break; |
| 478 |
|
case 'phone' : |
| 479 |
|
$this->posted[ $key ] = wc_format_phone_number( $this->posted[ $key ] ); |
| 480 |
|
|
| 481 |
|
if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) ) |
| 482 |
|
wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid phone number.', 'woocommerce' ), 'error' ); |
| 483 |
|
break; |
| 484 |
|
case 'email' : |
| 485 |
|
$this->posted[ $key ] = strtolower( $this->posted[ $key ] ); |
| 486 |
|
|
|
@@ 484-489 (lines=6) @@
|
| 481 |
|
if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) ) |
| 482 |
|
wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid phone number.', 'woocommerce' ), 'error' ); |
| 483 |
|
break; |
| 484 |
|
case 'email' : |
| 485 |
|
$this->posted[ $key ] = strtolower( $this->posted[ $key ] ); |
| 486 |
|
|
| 487 |
|
if ( ! is_email( $this->posted[ $key ] ) ) |
| 488 |
|
wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid email address.', 'woocommerce' ), 'error' ); |
| 489 |
|
break; |
| 490 |
|
case 'state' : |
| 491 |
|
// Get valid states |
| 492 |
|
$valid_states = WC()->countries->get_states( isset( $_POST[ $fieldset_key . '_country' ] ) ? $_POST[ $fieldset_key . '_country' ] : ( 'billing' === $fieldset_key ? WC()->customer->get_country() : WC()->customer->get_shipping_country() ) ); |