[?] [?]  [?]  [?]

% /> />

+

style="display:none;" class="local_tax_rates">

[?] [?] [?]  [?]  [?]
% /> />
$value ) : $country = woocommerce_clean($country); if (sizeof($value)>0 && $value[0]!=='*') : $states_count+=sizeof($value); endif; if ( ! in_array( $country, $counties_array ) ) $counties_array[] = esc_html( $woocommerce->countries->countries[ $country ] ); endforeach; $states_text = ''; $countries_text = implode(', ', $counties_array); // Show label if (sizeof($counties_array)==0) : $return .= __( 'No countries selected', 'woocommerce' ); elseif ( sizeof($counties_array) < 6 ) : if ($states_count>0) $states_text = sprintf(_n('(1 state)', '(%s states)', $states_count, 'woocommerce'), $states_count); $return .= $countries_text . ' ' . $states_text; else : if ($states_count>0) $states_text = sprintf(_n('and 1 state', 'and %s states', $states_count, 'woocommerce'), $states_count); $return .= sprintf(_n('1 country', '%1$s countries', sizeof($counties_array), 'woocommerce'), sizeof($counties_array)) . ' ' . $states_text; endif; return $return; } /** * woocommerce_export_tax_rates function. * * @access public * @return void */ function woocommerce_export_tax_rates() { if ( empty( $_GET['wc_export_tax_rates'] ) ) return; global $woocommerce; if ( ! class_exists('WC_CSV_Exporter') ) include( $woocommerce->plugin_path() . '/admin/includes/class-wc-csv-exporter.php' ); $export = absint( $_GET['wc_export_tax_rates'] ); if ( $export == 1 ) { $tax_rates = get_option('woocommerce_tax_rates'); $csv = new WC_CSV_Exporter( array( 'countries', 'class', 'label', 'rate', 'compound', 'shipping' ), true, 'tax_rates.csv' ); if ( $tax_rates ) foreach( $tax_rates as $rate ) { $countries = array(); foreach ( $rate['countries'] as $country => $states ) { foreach( $states as $state ) { if ( $state == '*' ) { $countries[] = $country; } else { $countries[] = $country . ':' . $state; } } } $csv->add_row( array( implode( ' | ', $countries ), $rate['class'], $rate['label'], $rate['rate'], $rate['compound'] == 'yes' ? 1 : 0, $rate['shipping'] == 'yes' ? 1 : 0 ) ); } $csv->end(); } else { $tax_rates = get_option('woocommerce_local_tax_rates'); $csv = new WC_CSV_Exporter( array( 'country', 'state', 'postcode', 'class', 'label', 'rate', 'compound', 'shipping' ), true, 'local_tax_rates.csv' ); if ( $tax_rates ) foreach( $tax_rates as $rate ) { $csv->add_row( array( $rate['country'], $rate['state'], implode( ' | ', $rate['postcode'] ), $rate['class'], $rate['label'], $rate['rate'], $rate['compound'] == 'yes' ? 1 : 0, $rate['shipping'] == 'yes' ? 1 : 0 ) ); } $csv->end(); } }