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() {
|
public function get_default_address_fields() {
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'country' => array(
|
'country' => array(
|
||||||
'type' => 'country',
|
'type' => 'country',
|
||||||
'label' => __( 'Country', 'woocommerce' ),
|
'label' => __( 'Country', 'woocommerce' ),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => array( 'form-row-wide', 'address-field', 'update_totals_on_change' ),
|
'class' => array( 'form-row-wide', 'address-field', 'update_totals_on_change' ),
|
||||||
),
|
),
|
||||||
'first_name' => array(
|
'first_name' => array(
|
||||||
'label' => __( 'First Name', 'woocommerce' ),
|
'label' => __( 'First Name', 'woocommerce' ),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => array( 'form-row-first' ),
|
'class' => array( 'form-row-first' ),
|
||||||
),
|
),
|
||||||
'last_name' => array(
|
'last_name' => array(
|
||||||
'label' => __( 'Last Name', 'woocommerce' ),
|
'label' => __( 'Last Name', 'woocommerce' ),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => array( 'form-row-last' ),
|
'class' => array( 'form-row-last' ),
|
||||||
'clear' => true
|
'clear' => true
|
||||||
),
|
),
|
||||||
'company' => array(
|
'company' => array(
|
||||||
'label' => __( 'Company Name', 'woocommerce' ),
|
'label' => __( 'Company Name', 'woocommerce' ),
|
||||||
'class' => array( 'form-row-wide' ),
|
'class' => array( 'form-row-wide' ),
|
||||||
),
|
),
|
||||||
'address_1' => array(
|
'address_1' => array(
|
||||||
'label' => __( 'Address', 'woocommerce' ),
|
'label' => __( 'Address', 'woocommerce' ),
|
||||||
'placeholder' => _x( 'Street address', 'placeholder', 'woocommerce' ),
|
'placeholder' => _x( 'Street address', 'placeholder', 'woocommerce' ),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => array( 'form-row-wide', 'address-field' ),
|
'class' => array( 'form-row-wide', 'address-field' ),
|
||||||
),
|
'custom_attributes' => array(
|
||||||
'address_2' => array(
|
'autocomplete' => 'no'
|
||||||
'placeholder' => _x( 'Apartment, suite, unit etc. (optional)', 'placeholder', 'woocommerce' ),
|
)
|
||||||
'class' => array( 'form-row-wide', 'address-field' ),
|
),
|
||||||
'required' => false
|
'address_2' => array(
|
||||||
),
|
'placeholder' => _x( 'Apartment, suite, unit etc. (optional)', 'placeholder', 'woocommerce' ),
|
||||||
'city' => array(
|
'class' => array( 'form-row-wide', 'address-field' ),
|
||||||
'label' => __( 'Town / City', 'woocommerce' ),
|
'required' => false,
|
||||||
'placeholder' => __( 'Town / City', 'woocommerce' ),
|
'custom_attributes' => array(
|
||||||
'required' => true,
|
'autocomplete' => 'no'
|
||||||
'class' => array( 'form-row-wide', 'address-field' ),
|
)
|
||||||
),
|
),
|
||||||
'state' => array(
|
'city' => array(
|
||||||
'type' => 'state',
|
'label' => __( 'Town / City', 'woocommerce' ),
|
||||||
'label' => __( 'State / County', 'woocommerce' ),
|
'placeholder' => __( 'Town / City', 'woocommerce' ),
|
||||||
'placeholder' => __( 'State / County', 'woocommerce' ),
|
'required' => true,
|
||||||
'required' => true,
|
'class' => array( 'form-row-wide', 'address-field' ),
|
||||||
'class' => array( 'form-row-first', 'address-field' )
|
'custom_attributes' => array(
|
||||||
),
|
'autocomplete' => 'no'
|
||||||
'postcode' => array(
|
)
|
||||||
'label' => __( 'Postcode / Zip', 'woocommerce' ),
|
),
|
||||||
'placeholder' => __( 'Postcode / Zip', 'woocommerce' ),
|
'state' => array(
|
||||||
'required' => true,
|
'type' => 'state',
|
||||||
'class' => array( 'form-row-last', 'address-field' ),
|
'label' => __( 'State / County', 'woocommerce' ),
|
||||||
'clear' => true
|
'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 );
|
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 =
|
= X =
|
||||||
* Tweak - Notices during checkout for admin users if the checkout is mis-configured.
|
* 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.
|
* Fix - Clear rating transients when editing comments.
|
||||||
* Localization - Netherlands, Hungarian, Taiwan, Italian, Spanish updates.
|
* Localization - Netherlands, Hungarian, Taiwan, Italian, Spanish updates.
|
||||||
* Other minor fixes and localisation updates.
|
* Other minor fixes and localisation updates.
|
||||||
|
|
Loading…
Reference in New Issue