Disable autocomplete for checkout fields which refresh totals - no events get fired on autocomplete. Closes #3022
This commit is contained in:
parent
7949349a79
commit
962caf204d
|
@ -673,58 +673,73 @@ class WC_Countries {
|
|||
*/
|
||||
public function get_default_address_fields() {
|
||||
$fields = array(
|
||||
'country' => array(
|
||||
'type' => 'country',
|
||||
'label' => __( 'Country', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-wide', 'address-field', 'update_totals_on_change' ),
|
||||
),
|
||||
'first_name' => array(
|
||||
'label' => __( 'First Name', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-first' ),
|
||||
),
|
||||
'last_name' => array(
|
||||
'label' => __( 'Last Name', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-last' ),
|
||||
'clear' => true
|
||||
),
|
||||
'company' => array(
|
||||
'label' => __( 'Company Name', 'woocommerce' ),
|
||||
'class' => array( 'form-row-wide' ),
|
||||
),
|
||||
'address_1' => array(
|
||||
'label' => __( 'Address', 'woocommerce' ),
|
||||
'placeholder' => _x( 'Street address', 'placeholder', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-wide', 'address-field' ),
|
||||
),
|
||||
'address_2' => array(
|
||||
'placeholder' => _x( 'Apartment, suite, unit etc. (optional)', 'placeholder', 'woocommerce' ),
|
||||
'class' => array( 'form-row-wide', 'address-field' ),
|
||||
'required' => false
|
||||
),
|
||||
'city' => array(
|
||||
'label' => __( 'Town / City', 'woocommerce' ),
|
||||
'placeholder' => __( 'Town / City', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-wide', 'address-field' ),
|
||||
),
|
||||
'state' => array(
|
||||
'type' => 'state',
|
||||
'label' => __( 'State / County', 'woocommerce' ),
|
||||
'placeholder' => __( 'State / County', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-first', 'address-field' )
|
||||
),
|
||||
'postcode' => array(
|
||||
'label' => __( 'Postcode / Zip', 'woocommerce' ),
|
||||
'placeholder' => __( 'Postcode / Zip', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-last', 'address-field' ),
|
||||
'clear' => true
|
||||
),
|
||||
'country' => array(
|
||||
'type' => 'country',
|
||||
'label' => __( 'Country', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-wide', 'address-field', 'update_totals_on_change' ),
|
||||
),
|
||||
'first_name' => array(
|
||||
'label' => __( 'First Name', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-first' ),
|
||||
),
|
||||
'last_name' => array(
|
||||
'label' => __( 'Last Name', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-last' ),
|
||||
'clear' => true
|
||||
),
|
||||
'company' => array(
|
||||
'label' => __( 'Company Name', 'woocommerce' ),
|
||||
'class' => array( 'form-row-wide' ),
|
||||
),
|
||||
'address_1' => array(
|
||||
'label' => __( 'Address', 'woocommerce' ),
|
||||
'placeholder' => _x( 'Street address', 'placeholder', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-wide', 'address-field' ),
|
||||
'custom_attributes' => array(
|
||||
'autocomplete' => 'no'
|
||||
)
|
||||
),
|
||||
'address_2' => array(
|
||||
'placeholder' => _x( 'Apartment, suite, unit etc. (optional)', 'placeholder', 'woocommerce' ),
|
||||
'class' => array( 'form-row-wide', 'address-field' ),
|
||||
'required' => false,
|
||||
'custom_attributes' => array(
|
||||
'autocomplete' => 'no'
|
||||
)
|
||||
),
|
||||
'city' => array(
|
||||
'label' => __( 'Town / City', 'woocommerce' ),
|
||||
'placeholder' => __( 'Town / City', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-wide', 'address-field' ),
|
||||
'custom_attributes' => array(
|
||||
'autocomplete' => 'no'
|
||||
)
|
||||
),
|
||||
'state' => array(
|
||||
'type' => 'state',
|
||||
'label' => __( 'State / County', 'woocommerce' ),
|
||||
'placeholder' => __( 'State / County', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-first', 'address-field' ),
|
||||
'custom_attributes' => array(
|
||||
'autocomplete' => 'no'
|
||||
)
|
||||
),
|
||||
'postcode' => array(
|
||||
'label' => __( 'Postcode / Zip', 'woocommerce' ),
|
||||
'placeholder' => __( 'Postcode / Zip', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'class' => array( 'form-row-last', 'address-field' ),
|
||||
'clear' => true,
|
||||
'custom_attributes' => array(
|
||||
'autocomplete' => 'no'
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
return apply_filters( 'woocommerce_default_address_fields', $fields );
|
||||
|
|
|
@ -167,6 +167,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
|
|||
|
||||
= X =
|
||||
* Tweak - Notices during checkout for admin users if the checkout is mis-configured.
|
||||
* Fix - Disable autocomplete for checkout fields which refresh totals - no events get fired on autocomplete.
|
||||
* Fix - Clear rating transients when editing comments.
|
||||
* Localization - Netherlands, Hungarian, Taiwan, Italian, Spanish updates.
|
||||
* Other minor fixes and localisation updates.
|
||||
|
|
Loading…
Reference in New Issue