|
@@ 504-509 (lines=6) @@
|
| 501 |
|
$this->posted[ $key ] = wc_format_postcode( $this->posted[ $key ], $_POST[ $fieldset_key . '_country' ] ); |
| 502 |
|
endif; |
| 503 |
|
break; |
| 504 |
|
case 'phone' : |
| 505 |
|
$this->posted[ $key ] = wc_format_phone_number( $this->posted[ $key ] ); |
| 506 |
|
|
| 507 |
|
if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) ) |
| 508 |
|
wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid phone number.', 'woocommerce' ), 'error' ); |
| 509 |
|
break; |
| 510 |
|
case 'email' : |
| 511 |
|
$this->posted[ $key ] = strtolower( $this->posted[ $key ] ); |
| 512 |
|
|
|
@@ 510-515 (lines=6) @@
|
| 507 |
|
if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) ) |
| 508 |
|
wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid phone number.', 'woocommerce' ), 'error' ); |
| 509 |
|
break; |
| 510 |
|
case 'email' : |
| 511 |
|
$this->posted[ $key ] = strtolower( $this->posted[ $key ] ); |
| 512 |
|
|
| 513 |
|
if ( ! is_email( $this->posted[ $key ] ) ) |
| 514 |
|
wc_add_notice( '<strong>' . $field['label'] . '</strong> ' . __( 'is not a valid email address.', 'woocommerce' ), 'error' ); |
| 515 |
|
break; |
| 516 |
|
case 'state' : |
| 517 |
|
// Get valid states |
| 518 |
|
$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() ) ); |