class-wc-settings-rest-api.php
5 years ago
html-admin-page-shipping-classes.php
1 month ago
html-admin-page-shipping-providers.php
1 month ago
html-admin-page-shipping-zone-methods.php
1 month ago
html-admin-page-shipping-zones-instance.php
8 years ago
html-admin-page-shipping-zones.php
1 month ago
html-keys-edit.php
1 month ago
html-settings-tax.php
1 year ago
html-webhooks-edit.php
1 month ago
settings-tax.php
2 months ago
html-settings-tax.php
165 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin view: Settings tax |
| 4 | * |
| 5 | * @package WooCommerce\Admin\Settings |
| 6 | */ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; |
| 10 | } |
| 11 | ?> |
| 12 | |
| 13 | <div class="wc-tax-rates-search" id="rates-search"> |
| 14 | <input type="search" class="wc-tax-rates-search-field" placeholder="<?php esc_attr_e( 'Search…', 'woocommerce' ); ?>" value="<?php echo isset( $_GET['s'] ) ? esc_attr( $_GET['s'] ) : ''; ?>" /> |
| 15 | </div> |
| 16 | |
| 17 | <div id="rates-pagination"></div> |
| 18 | |
| 19 | <h3> |
| 20 | <?php |
| 21 | /* translators: %s: tax rate */ |
| 22 | printf( |
| 23 | __( '"%s" tax rates', 'woocommerce' ), |
| 24 | $current_class ? esc_html( $current_class ) : __( 'Standard', 'woocommerce' ) |
| 25 | ); |
| 26 | ?> |
| 27 | </h3> |
| 28 | |
| 29 | <table class="wc_tax_rates wc_input_table widefat"> |
| 30 | <thead> |
| 31 | <tr> |
| 32 | <th width="8%"><a href="https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes" target="_blank"><?php _e( 'Country code', 'woocommerce' ); ?></a> <?php echo wc_help_tip( __( 'A 2 digit country code, e.g. US. Leave blank to apply to all.', 'woocommerce' ) ); ?></th> |
| 33 | <th width="8%"><?php _e( 'State code', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'A 2 digit state code, e.g. AL. Leave blank to apply to all.', 'woocommerce' ) ); ?></th> |
| 34 | <th><?php _e( 'Postcode / ZIP', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Postcode for this rule. Semi-colon (;) separate multiple values. Leave blank to apply to all areas. Wildcards (*) and ranges for numeric postcodes (e.g. 12345...12350) can also be used.', 'woocommerce' ) ); ?></th> |
| 35 | <th><?php _e( 'City', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Cities for this rule. Semi-colon (;) separate multiple values. Leave blank to apply to all cities.', 'woocommerce' ) ); ?></th> |
| 36 | <th width="8%"><?php _e( 'Rate %', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Enter a tax rate (percentage) to 4 decimal places.', 'woocommerce' ) ); ?></th> |
| 37 | <th width="8%"><?php _e( 'Tax name', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Enter a name for this tax rate.', 'woocommerce' ) ); ?></th> |
| 38 | <th width="8%"><?php _e( 'Priority', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Choose a priority for this tax rate. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate.', 'woocommerce' ) ); ?></th> |
| 39 | <th width="8%"><?php _e( 'Compound', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Choose whether or not this is a compound rate. Compound tax rates are applied on top of other tax rates.', 'woocommerce' ) ); ?></th> |
| 40 | <th width="8%"><?php _e( 'Shipping', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Choose whether or not this tax rate also gets applied to shipping.', 'woocommerce' ) ); ?></th> |
| 41 | </tr> |
| 42 | </thead> |
| 43 | <tfoot> |
| 44 | <tr> |
| 45 | <th colspan="9"> |
| 46 | <a href="#" class="button plus insert"><?php _e( 'Insert row', 'woocommerce' ); ?></a> |
| 47 | <a href="#" class="button minus remove_tax_rates"><?php _e( 'Remove selected row(s)', 'woocommerce' ); ?></a> |
| 48 | <a href="#" download="tax_rates.csv" class="button export"><?php _e( 'Export CSV', 'woocommerce' ); ?></a> |
| 49 | <a href="<?php echo admin_url( 'admin.php?import=woocommerce_tax_rate_csv' ); ?>" class="button import"><?php _e( 'Import CSV', 'woocommerce' ); ?></a> |
| 50 | </th> |
| 51 | </tr> |
| 52 | </tfoot> |
| 53 | <tbody id="rates"> |
| 54 | <tr> |
| 55 | <th colspan="9" style="text-align: center;"><?php esc_html_e( 'Loading…', 'woocommerce' ); ?></th> |
| 56 | </tr> |
| 57 | </tbody> |
| 58 | </table> |
| 59 | |
| 60 | <div id="rates-bottom-pagination"></div> |
| 61 | |
| 62 | <script type="text/html" id="tmpl-wc-tax-table-row"> |
| 63 | <tr class="tips" data-tip="<?php printf( esc_attr__( 'Tax rate ID: %s', 'woocommerce' ), '{{ data.tax_rate_id }}' ); ?>" data-id="{{ data.tax_rate_id }}"> |
| 64 | <td class="country"> |
| 65 | <input type="text" value="{{ data.tax_rate_country }}" placeholder="*" name="tax_rate_country[{{ data.tax_rate_id }}]" class="wc_input_country_iso" data-attribute="tax_rate_country" style="text-transform:uppercase" /> |
| 66 | </td> |
| 67 | |
| 68 | <td class="state"> |
| 69 | <input type="text" value="{{ data.tax_rate_state }}" placeholder="*" name="tax_rate_state[{{ data.tax_rate_id }}]" data-attribute="tax_rate_state" /> |
| 70 | </td> |
| 71 | |
| 72 | <td class="postcode"> |
| 73 | <input type="text" value="<# if ( data.postcode ) print( _.escape( data.postcode.join( '; ' ) ) ); #>" placeholder="*" data-name="tax_rate_postcode[{{ data.tax_rate_id }}]" data-attribute="postcode" /> |
| 74 | </td> |
| 75 | |
| 76 | <td class="city"> |
| 77 | <input type="text" value="<# if ( data.city ) print( _.escape( data.city.join( '; ' ) ) ); #>" placeholder="*" data-name="tax_rate_city[{{ data.tax_rate_id }}]" data-attribute="city" /> |
| 78 | </td> |
| 79 | |
| 80 | <td class="rate"> |
| 81 | <input type="text" value="{{ data.tax_rate }}" placeholder="0" name="tax_rate[{{ data.tax_rate_id }}]" data-attribute="tax_rate" /> |
| 82 | </td> |
| 83 | |
| 84 | <td class="name"> |
| 85 | <input type="text" value="{{ data.tax_rate_name }}" name="tax_rate_name[{{ data.tax_rate_id }}]" data-attribute="tax_rate_name" /> |
| 86 | </td> |
| 87 | |
| 88 | <td class="priority"> |
| 89 | <input type="number" step="1" min="1" value="{{ data.tax_rate_priority }}" name="tax_rate_priority[{{ data.tax_rate_id }}]" data-attribute="tax_rate_priority" /> |
| 90 | </td> |
| 91 | |
| 92 | <td class="compound"> |
| 93 | <input type="checkbox" class="checkbox" name="tax_rate_compound[{{ data.tax_rate_id }}]" <# if ( parseInt( data.tax_rate_compound, 10 ) ) { #> checked="checked" <# } #> data-attribute="tax_rate_compound" /> |
| 94 | </td> |
| 95 | |
| 96 | <td class="apply_to_shipping"> |
| 97 | <input type="checkbox" class="checkbox" name="tax_rate_shipping[{{ data.tax_rate_id }}]" <# if ( parseInt( data.tax_rate_shipping, 10 ) ) { #> checked="checked" <# } #> data-attribute="tax_rate_shipping" /> |
| 98 | </td> |
| 99 | </tr> |
| 100 | </script> |
| 101 | |
| 102 | <script type="text/html" id="tmpl-wc-tax-table-row-empty"> |
| 103 | <tr> |
| 104 | <th colspan="9" style="text-align:center"><?php esc_html_e( 'No matching tax rates found.', 'woocommerce' ); ?></th> |
| 105 | </tr> |
| 106 | </script> |
| 107 | |
| 108 | <script type="text/html" id="tmpl-wc-tax-table-pagination"> |
| 109 | <div class="tablenav"> |
| 110 | <div class="tablenav-pages"> |
| 111 | <span class="displaying-num"> |
| 112 | <?php |
| 113 | /* translators: %s: number */ |
| 114 | printf( |
| 115 | __( '%s items', 'woocommerce' ), // %s will be a number eventually, but must be a string for now. |
| 116 | '{{ data.qty_rates }}' |
| 117 | ); |
| 118 | ?> |
| 119 | </span> |
| 120 | <span class="pagination-links"> |
| 121 | <# if ( data.current_page === 1 ) { #> |
| 122 | <span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span> |
| 123 | <span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span> |
| 124 | <# } else { #> |
| 125 | <a class="button" data-goto="1"> |
| 126 | <span class="screen-reader-text"><?php esc_html_e( 'First page', 'woocommerce' ); ?></span> |
| 127 | <span aria-hidden="true">«</span> |
| 128 | </a> |
| 129 | <a class="button" data-goto="<# print( Math.max( 1, parseInt( data.current_page, 10 ) - 1 ) ) #>"> |
| 130 | <span class="screen-reader-text"><?php esc_html_e( 'Previous page', 'woocommerce' ); ?></span> |
| 131 | <span aria-hidden="true">‹</span> |
| 132 | </a> |
| 133 | <# } #> |
| 134 | |
| 135 | <span class="paging-input"> |
| 136 | <label for="current-page-selector" class="screen-reader-text"><?php esc_html_e( 'Current page', 'woocommerce' ); ?></label> |
| 137 | <?php |
| 138 | /* translators: 1: current page 2: total pages */ |
| 139 | printf( |
| 140 | esc_html_x( '%1$s of %2$s', 'Pagination', 'woocommerce' ), |
| 141 | '<input class="current-page" id="current-page-selector" type="text" name="paged" value="{{ data.current_page }}" size="<# print( data.qty_pages.toString().length ) #>" aria-describedby="table-paging">', |
| 142 | '<span class="total-pages">{{ data.qty_pages }}</span>' |
| 143 | ); |
| 144 | ?> |
| 145 | </span> |
| 146 | |
| 147 | <# if ( data.current_page === data.qty_pages ) { #> |
| 148 | <span class="tablenav-pages-navspan button disabled" aria-hidden="true">›</span> |
| 149 | <span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span> |
| 150 | <# } else { #> |
| 151 | <a class="button" data-goto="<# print( Math.min( data.qty_pages, parseInt( data.current_page, 10 ) + 1 ) ) #>"> |
| 152 | <span class="screen-reader-text"><?php esc_html_e( 'Next page', 'woocommerce' ); ?></span> |
| 153 | <span aria-hidden="true">›</span> |
| 154 | </a> |
| 155 | <a class="button" data-goto="{{ data.qty_pages }}"> |
| 156 | <span class="screen-reader-text"><?php esc_html_e( 'Last page', 'woocommerce' ); ?></span> |
| 157 | <span aria-hidden="true">»</span> |
| 158 | </a> |
| 159 | <# } #> |
| 160 | |
| 161 | </span> |
| 162 | </div> |
| 163 | </div> |
| 164 | </script> |
| 165 |