Refresh totals on field change, and format tax price if numeric.

This commit is contained in:
Mike Jolley 2013-03-25 11:41:39 +00:00
parent 218a5eed1c
commit c9b6b4a302
3 changed files with 4 additions and 4 deletions

View File

@ -171,7 +171,7 @@ jQuery(document).ready(function($) {
})
// Address-fields which refresh totals when all required fields are filled
.on( 'change', '.address-field input.input-text', function() {
.on( 'change', '.address-field input.input-text, .update_totals_on_change input.input-text', function() {
if ( dirtyInput ) {
input_changed();
}
@ -182,7 +182,7 @@ jQuery(document).ready(function($) {
input_changed();
})
.on( 'keydown', '.address-field input.input-text', function( e ){
.on( 'keydown', '.address-field input.input-text, .update_totals_on_change input.input-text', function( e ){
var code = e.keyCode || e.which;
if ( code == '9' )
return;

File diff suppressed because one or more lines are too long

View File

@ -722,7 +722,7 @@ class WC_Cart {
$taxes = $this->get_taxes();
foreach ( $taxes as $key => $tax )
if ( $tax > 0 )
if ( is_numeric( $tax ) )
$taxes[ $key ] = woocommerce_price( $tax );
return apply_filters( 'woocommerce_cart_formatted_taxes', $taxes, $this );