Sin descripción

html-settings-tax.php 7.6KB

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