Phone was required in 3.3 - set default

This commit is contained in:
Mike Jolley 2018-04-26 11:52:36 +01:00
parent e15a4f63a0
commit d73d15a73d
2 changed files with 3 additions and 3 deletions

View File

@ -1216,10 +1216,10 @@ class WC_Countries {
// Add email and phone fields. // Add email and phone fields.
if ( 'billing_' === $type ) { if ( 'billing_' === $type ) {
if ( 'hidden' !== get_option( 'woocommerce_checkout_phone_field', 'optional' ) ) { if ( 'hidden' !== get_option( 'woocommerce_checkout_phone_field', 'required' ) ) {
$address_fields['billing_phone'] = array( $address_fields['billing_phone'] = array(
'label' => __( 'Phone', 'woocommerce' ), 'label' => __( 'Phone', 'woocommerce' ),
'required' => 'required' === get_option( 'woocommerce_checkout_phone_field', 'optional' ), 'required' => 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ),
'type' => 'tel', 'type' => 'tel',
'class' => array( 'form-row-wide' ), 'class' => array( 'form-row-wide' ),
'validate' => array( 'phone' ), 'validate' => array( 'phone' ),

View File

@ -708,7 +708,7 @@ class WC_Shop_Customizer {
$wp_customize->add_setting( $wp_customize->add_setting(
'woocommerce_checkout_' . $field . '_field', 'woocommerce_checkout_' . $field . '_field',
array( array(
'default' => 'optional', 'default' => 'phone' === $field ? 'required' : 'optional',
'type' => 'option', 'type' => 'option',
'capability' => 'manage_woocommerce', 'capability' => 'manage_woocommerce',
'sanitize_callback' => array( $this, 'sanitize_checkout_field_display' ), 'sanitize_callback' => array( $this, 'sanitize_checkout_field_display' ),