html-settings-tax.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. exit;
  4. }
  5. ?>
  6. <div class="wc-tax-rates-search" id="rates-search">
  7. <input type="search" class="wc-tax-rates-search-field" placeholder="<?php esc_attr_e( 'Search&hellip;', 'woocommerce' ); ?>" value="<?php echo isset( $_GET['s'] ) ? esc_attr( $_GET['s'] ) : ''; ?>" />
  8. </div>
  9. <div id="rates-pagination"></div>
  10. <h3>
  11. <?php
  12. /* translators: %s: tax rate */
  13. printf(
  14. __( '"%s" tax rates', 'woocommerce' ),
  15. $current_class ? esc_html( $current_class ) : __( 'Standard', 'woocommerce' )
  16. );
  17. ?>
  18. </h3>
  19. <table class="wc_tax_rates wc_input_table widefat">
  20. <thead>
  21. <tr>
  22. <th width="8%"><a href="https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes" target="_blank"><?php _e( 'Country&nbsp;code', 'woocommerce' ); ?></a>&nbsp;<?php echo wc_help_tip( __( 'A 2 digit country code, e.g. US. Leave blank to apply to all.', 'woocommerce' ) ); ?></th>
  23. <th width="8%"><?php _e( 'State code', 'woocommerce' ); ?>&nbsp;<?php echo wc_help_tip( __( 'A 2 digit state code, e.g. AL. Leave blank to apply to all.', 'woocommerce' ) ); ?></th>
  24. <th><?php _e( 'Postcode / ZIP', 'woocommerce' ); ?>&nbsp;<?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>
  25. <th><?php _e( 'City', 'woocommerce' ); ?>&nbsp;<?php echo wc_help_tip( __( 'Cities for this rule. Semi-colon (;) separate multiple values. Leave blank to apply to all cities.', 'woocommerce' ) ); ?></th>
  26. <th width="8%"><?php _e( 'Rate&nbsp;%', 'woocommerce' ); ?>&nbsp;<?php echo wc_help_tip( __( 'Enter a tax rate (percentage) to 4 decimal places.', 'woocommerce' ) ); ?></th>
  27. <th width="8%"><?php _e( 'Tax name', 'woocommerce' ); ?>&nbsp;<?php echo wc_help_tip( __( 'Enter a name for this tax rate.', 'woocommerce' ) ); ?></th>
  28. <th width="8%"><?php _e( 'Priority', 'woocommerce' ); ?>&nbsp;<?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>
  29. <th width="8%"><?php _e( 'Compound', 'woocommerce' ); ?>&nbsp;<?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>
  30. <th width="8%"><?php _e( 'Shipping', 'woocommerce' ); ?>&nbsp;<?php echo wc_help_tip( __( 'Choose whether or not this tax rate also gets applied to shipping.', 'woocommerce' ) ); ?></th>
  31. </tr>
  32. </thead>
  33. <tfoot>
  34. <tr>
  35. <th colspan="9">
  36. <a href="#" class="button plus insert"><?php _e( 'Insert row', 'woocommerce' ); ?></a>
  37. <a href="#" class="button minus remove_tax_rates"><?php _e( 'Remove selected row(s)', 'woocommerce' ); ?></a>
  38. <a href="#" download="tax_rates.csv" class="button export"><?php _e( 'Export CSV', 'woocommerce' ); ?></a>
  39. <a href="<?php echo admin_url( 'admin.php?import=woocommerce_tax_rate_csv' ); ?>" class="button import"><?php _e( 'Import CSV', 'woocommerce' ); ?></a>
  40. </th>
  41. </tr>
  42. </tfoot>
  43. <tbody id="rates">
  44. <tr>
  45. <th colspan="9" style="text-align: center;"><?php esc_html_e( 'Loading&hellip;', 'woocommerce' ); ?></th>
  46. </tr>
  47. </tbody>
  48. </table>
  49. <script type="text/html" id="tmpl-wc-tax-table-row">
  50. <tr class="tips" data-tip="<?php printf( esc_attr__( 'Tax rate ID: %s', 'woocommerce' ), '{{ data.tax_rate_id }}' ); ?>" data-id="{{ data.tax_rate_id }}">
  51. <td class="country">
  52. <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" />
  53. </td>
  54. <td class="state">
  55. <input type="text" value="{{ data.tax_rate_state }}" placeholder="*" name="tax_rate_state[{{ data.tax_rate_id }}]" data-attribute="tax_rate_state" />
  56. </td>
  57. <td class="postcode">
  58. <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" />
  59. </td>
  60. <td class="city">
  61. <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" />
  62. </td>
  63. <td class="rate">
  64. <input type="text" value="{{ data.tax_rate }}" placeholder="0" name="tax_rate[{{ data.tax_rate_id }}]" data-attribute="tax_rate" />
  65. </td>
  66. <td class="name">
  67. <input type="text" value="{{ data.tax_rate_name }}" name="tax_rate_name[{{ data.tax_rate_id }}]" data-attribute="tax_rate_name" />
  68. </td>
  69. <td class="priority">
  70. <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" />
  71. </td>
  72. <td class="compound">
  73. <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" />
  74. </td>
  75. <td class="apply_to_shipping">
  76. <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" />
  77. </td>
  78. </tr>
  79. </script>
  80. <script type="text/html" id="tmpl-wc-tax-table-row-empty">
  81. <tr>
  82. <th colspan="9" style="text-align:center"><?php esc_html_e( 'No matching tax rates found.', 'woocommerce' ); ?></th>
  83. </tr>
  84. </script>
  85. <script type="text/html" id="tmpl-wc-tax-table-pagination">
  86. <div class="tablenav">
  87. <div class="tablenav-pages">
  88. <span class="displaying-num">
  89. <?php
  90. /* translators: %s: number */
  91. printf(
  92. __( '%s items', 'woocommerce' ), // %s will be a number eventually, but must be a string for now.
  93. '{{ data.qty_rates }}'
  94. );
  95. ?>
  96. </span>
  97. <span class="pagination-links">
  98. <a class="tablenav-pages-navspan" data-goto="1">
  99. <span class="screen-reader-text"><?php esc_html_e( 'First page', 'woocommerce' ); ?></span>
  100. <span aria-hidden="true">&laquo;</span>
  101. </a>
  102. <a class="tablenav-pages-navspan" data-goto="<# print( Math.max( 1, parseInt( data.current_page, 10 ) - 1 ) ) #>">
  103. <span class="screen-reader-text"><?php esc_html_e( 'Previous page', 'woocommerce' ); ?></span>
  104. <span aria-hidden="true">&lsaquo;</span>
  105. </a>
  106. <span class="paging-input">
  107. <label for="current-page-selector" class="screen-reader-text"><?php esc_html_e( 'Current page', 'woocommerce' ); ?></label>
  108. <?php
  109. /* translators: 1: current page 2: total pages */
  110. printf(
  111. esc_html_x( '%1$s of %2$s', 'Pagination', 'woocommerce' ),
  112. '<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">',
  113. '<span class="total-pages">{{ data.qty_pages }}</span>'
  114. );
  115. ?>
  116. </span>
  117. <a class="tablenav-pages-navspan" data-goto="<# print( Math.min( data.qty_pages, parseInt( data.current_page, 10 ) + 1 ) ) #>">
  118. <span class="screen-reader-text"><?php esc_html_e( 'Next page', 'woocommerce' ); ?></span>
  119. <span aria-hidden="true">&rsaquo;</span>
  120. </a>
  121. <a class="tablenav-pages-navspan" data-goto="{{ data.qty_pages }}">
  122. <span class="screen-reader-text"><?php esc_html_e( 'Last page', 'woocommerce' ); ?></span>
  123. <span aria-hidden="true">&raquo;</span>
  124. </a>
  125. </span>
  126. </div>
  127. </div>
  128. </script>