Disable autocomplete for checkout fields which refresh totals - no events get fired on autocomplete. Closes #3022

This commit is contained in:
Mike Jolley 2013-04-24 13:20:23 +01:00
parent 7949349a79
commit 962caf204d
2 changed files with 68 additions and 52 deletions

View File

@ -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 );

View File

@ -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.