From 20a90cddf91d14dd7ac76d8f5e79a7554223b640 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 3 Dec 2012 11:02:29 +0000 Subject: [PATCH] Fix checkbox export --- admin/settings/settings-tax-rates.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/admin/settings/settings-tax-rates.php b/admin/settings/settings-tax-rates.php index 3093ebcfddd..f76e2dc3fdb 100644 --- a/admin/settings/settings-tax-rates.php +++ b/admin/settings/settings-tax-rates.php @@ -184,14 +184,22 @@ function woocommerce_tax_rates_setting() { jQuery('#rates tr:visible').each(function() { var row = ''; jQuery(this).find('td:not(.sort) input').each(function() { - var val = jQuery(this).val(); - if ( ! val ) - val = jQuery(this).attr('placeholder'); - if ( val == 'on' ) - val = 1; - if ( val == 'off' ) - val = 0; + if ( jQuery(this).is('.checkbox') ) { + + if ( jQuery(this).is(':checked') ) { + val = 1; + } else { + val = 0; + } + + } else { + + var val = jQuery(this).val(); + + if ( ! val ) + val = jQuery(this).attr('placeholder'); + } row = row + val + ','; });