/wp-content/plugins/woocommerce/includes/admin/views/html-bulk-edit-product.php

https://gitlab.com/webkod3r/tripolis · PHP · 319 lines · 292 code · 24 blank · 3 comment · 7 complexity · 5dd39a4ac67e88ad4baf15dfb4903e44 MD5 · raw file

  1. <?php
  2. /**
  3. * Admin View: Bulk Edit Products
  4. */
  5. if ( ! defined( 'ABSPATH' ) ) {
  6. exit; // Exit if accessed directly
  7. }
  8. ?>
  9. <fieldset class="inline-edit-col-right">
  10. <div id="woocommerce-fields-bulk" class="inline-edit-col">
  11. <h4><?php _e( 'Product Data', 'woocommerce' ); ?></h4>
  12. <?php do_action( 'woocommerce_product_bulk_edit_start' ); ?>
  13. <div class="inline-edit-group">
  14. <label class="alignleft">
  15. <span class="title"><?php _e( 'Price', 'woocommerce' ); ?></span>
  16. <span class="input-text-wrap">
  17. <select class="change_regular_price change_to" name="change_regular_price">
  18. <?php
  19. $options = array(
  20. '' => __( '— No Change —', 'woocommerce' ),
  21. '1' => __( 'Change to:', 'woocommerce' ),
  22. '2' => __( 'Increase by (fixed amount or %):', 'woocommerce' ),
  23. '3' => __( 'Decrease by (fixed amount or %):', 'woocommerce' )
  24. );
  25. foreach ($options as $key => $value) {
  26. echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
  27. }
  28. ?>
  29. </select>
  30. </span>
  31. </label>
  32. <label class="change-input">
  33. <input type="text" name="_regular_price" class="text regular_price" placeholder="<?php echo sprintf( __( 'Enter price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?>" value="" />
  34. </label>
  35. </div>
  36. <div class="inline-edit-group">
  37. <label class="alignleft">
  38. <span class="title"><?php _e( 'Sale', 'woocommerce' ); ?></span>
  39. <span class="input-text-wrap">
  40. <select class="change_sale_price change_to" name="change_sale_price">
  41. <?php
  42. $options = array(
  43. '' => __( '— No Change —', 'woocommerce' ),
  44. '1' => __( 'Change to:', 'woocommerce' ),
  45. '2' => __( 'Increase by (fixed amount or %):', 'woocommerce' ),
  46. '3' => __( 'Decrease by (fixed amount or %):', 'woocommerce' ),
  47. '4' => __( 'Decrease regular price by (fixed amount or %):', 'woocommerce' )
  48. );
  49. foreach ( $options as $key => $value ) {
  50. echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
  51. }
  52. ?>
  53. </select>
  54. </span>
  55. </label>
  56. <label class="change-input">
  57. <input type="text" name="_sale_price" class="text sale_price" placeholder="<?php echo sprintf( __( 'Enter sale price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?>" value="" />
  58. </label>
  59. </div>
  60. <?php if ( wc_tax_enabled() ) : ?>
  61. <label>
  62. <span class="title"><?php _e( 'Tax Status', 'woocommerce' ); ?></span>
  63. <span class="input-text-wrap">
  64. <select class="tax_status" name="_tax_status">
  65. <?php
  66. $options = array(
  67. '' => __( '— No Change —', 'woocommerce' ),
  68. 'taxable' => __( 'Taxable', 'woocommerce' ),
  69. 'shipping' => __( 'Shipping only', 'woocommerce' ),
  70. 'none' => _x( 'None', 'Tax status', 'woocommerce' )
  71. );
  72. foreach ($options as $key => $value) {
  73. echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
  74. }
  75. ?>
  76. </select>
  77. </span>
  78. </label>
  79. <label>
  80. <span class="title"><?php _e( 'Tax Class', 'woocommerce' ); ?></span>
  81. <span class="input-text-wrap">
  82. <select class="tax_class" name="_tax_class">
  83. <?php
  84. $options = array(
  85. '' => __( '— No Change —', 'woocommerce' ),
  86. 'standard' => __( 'Standard', 'woocommerce' )
  87. );
  88. $tax_classes = WC_Tax::get_tax_classes();
  89. if ( $tax_classes )
  90. foreach ( $tax_classes as $class ) {
  91. $options[ sanitize_title( $class ) ] = esc_html( $class );
  92. }
  93. foreach ( $options as $key => $value ) {
  94. echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
  95. }
  96. ?>
  97. </select>
  98. </span>
  99. </label>
  100. <?php endif; ?>
  101. <?php if ( wc_product_weight_enabled() ) : ?>
  102. <div class="inline-edit-group">
  103. <label class="alignleft">
  104. <span class="title"><?php _e( 'Weight', 'woocommerce' ); ?></span>
  105. <span class="input-text-wrap">
  106. <select class="change_weight change_to" name="change_weight">
  107. <?php
  108. $options = array(
  109. '' => __( '— No Change —', 'woocommerce' ),
  110. '1' => __( 'Change to:', 'woocommerce' )
  111. );
  112. foreach ( $options as $key => $value ) {
  113. echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
  114. }
  115. ?>
  116. </select>
  117. </span>
  118. </label>
  119. <label class="change-input">
  120. <input type="text" name="_weight" class="text weight" placeholder="<?php echo sprintf( __( '%s (%s)', 'woocommerce' ), wc_format_localized_decimal( 0 ), get_option( 'woocommerce_weight_unit' ) ); ?>" value="">
  121. </label>
  122. </div>
  123. <?php endif; ?>
  124. <?php if ( wc_product_dimensions_enabled() ) : ?>
  125. <div class="inline-edit-group dimensions">
  126. <label class="alignleft">
  127. <span class="title"><?php _e( 'L/W/H', 'woocommerce' ); ?></span>
  128. <span class="input-text-wrap">
  129. <select class="change_dimensions change_to" name="change_dimensions">
  130. <?php
  131. $options = array(
  132. '' => __( '— No Change —', 'woocommerce' ),
  133. '1' => __( 'Change to:', 'woocommerce' )
  134. );
  135. foreach ( $options as $key => $value ) {
  136. echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
  137. }
  138. ?>
  139. </select>
  140. </span>
  141. </label>
  142. <label class="change-input">
  143. <input type="text" name="_length" class="text length" placeholder="<?php echo sprintf( __( 'Length (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
  144. <input type="text" name="_width" class="text width" placeholder="<?php echo sprintf( __( 'Width (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
  145. <input type="text" name="_height" class="text height" placeholder="<?php echo sprintf( __( 'Height (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
  146. </label>
  147. </div>
  148. <?php endif; ?>
  149. <label>
  150. <span class="title"><?php _e( 'Shipping class', 'woocommerce' ); ?></span>
  151. <span class="input-text-wrap">
  152. <select class="shipping_class" name="_shipping_class">
  153. <option value=""><?php _e( '— No Change —', 'woocommerce' ); ?></option>
  154. <option value="_no_shipping_class"><?php _e( 'No shipping class', 'woocommerce' ); ?></option>
  155. <?php
  156. foreach ( $shipping_class as $key => $value ) {
  157. echo '<option value="' . esc_attr( $value->slug ) . '">'. $value->name .'</option>';
  158. }
  159. ?>
  160. </select>
  161. </span>
  162. </label>
  163. <label>
  164. <span class="title"><?php _e( 'Visibility', 'woocommerce' ); ?></span>
  165. <span class="input-text-wrap">
  166. <select class="visibility" name="_visibility">
  167. <?php
  168. $options = array(
  169. '' => __( '— No Change —', 'woocommerce' ),
  170. 'visible' => __( 'Catalog &amp; search', 'woocommerce' ),
  171. 'catalog' => __( 'Catalog', 'woocommerce' ),
  172. 'search' => __( 'Search', 'woocommerce' ),
  173. 'hidden' => __( 'Hidden', 'woocommerce' )
  174. );
  175. foreach ( $options as $key => $value ) {
  176. echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
  177. }
  178. ?>
  179. </select>
  180. </span>
  181. </label>
  182. <label>
  183. <span class="title"><?php _e( 'Featured', 'woocommerce' ); ?></span>
  184. <span class="input-text-wrap">
  185. <select class="featured" name="_featured">
  186. <?php
  187. $options = array(
  188. '' => __( '— No Change —', 'woocommerce' ),
  189. 'yes' => __( 'Yes', 'woocommerce' ),
  190. 'no' => __( 'No', 'woocommerce' )
  191. );
  192. foreach ($options as $key => $value) {
  193. echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
  194. }
  195. ?>
  196. </select>
  197. </span>
  198. </label>
  199. <label>
  200. <span class="title"><?php _e( 'In stock?', 'woocommerce' ); ?></span>
  201. <span class="input-text-wrap">
  202. <select class="stock_status" name="_stock_status">
  203. <?php
  204. $options = array(
  205. '' => __( '— No Change —', 'woocommerce' ),
  206. 'instock' => __( 'In stock', 'woocommerce' ),
  207. 'outofstock' => __( 'Out of stock', 'woocommerce' )
  208. );
  209. foreach ( $options as $key => $value ) {
  210. echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
  211. }
  212. ?>
  213. </select>
  214. </span>
  215. </label>
  216. <?php if ( 'yes' == get_option( 'woocommerce_manage_stock' ) ) : ?>
  217. <label>
  218. <span class="title"><?php _e( 'Manage stock?', 'woocommerce' ); ?></span>
  219. <span class="input-text-wrap">
  220. <select class="manage_stock" name="_manage_stock">
  221. <?php
  222. $options = array(
  223. '' => __( '— No Change —', 'woocommerce' ),
  224. 'yes' => __( 'Yes', 'woocommerce' ),
  225. 'no' => __( 'No', 'woocommerce' )
  226. );
  227. foreach ( $options as $key => $value ) {
  228. echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
  229. }
  230. ?>
  231. </select>
  232. </span>
  233. </label>
  234. <div class="inline-edit-group">
  235. <label class="alignleft stock_qty_field">
  236. <span class="title"><?php _e( 'Stock Qty', 'woocommerce' ); ?></span>
  237. <span class="input-text-wrap">
  238. <select class="change_stock change_to" name="change_stock">
  239. <?php
  240. $options = array(
  241. '' => __( '— No Change —', 'woocommerce' ),
  242. '1' => __( 'Change to:', 'woocommerce' )
  243. );
  244. foreach ( $options as $key => $value ) {
  245. echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
  246. }
  247. ?>
  248. </select>
  249. </span>
  250. </label>
  251. <label class="change-input">
  252. <input type="text" name="_stock" class="text stock" placeholder="<?php esc_attr_e( 'Stock Qty', 'woocommerce' ); ?>" step="any" value="">
  253. </label>
  254. </div>
  255. <label>
  256. <span class="title"><?php _e( 'Backorders?', 'woocommerce' ); ?></span>
  257. <span class="input-text-wrap">
  258. <select class="backorders" name="_backorders">
  259. <?php
  260. $options = array(
  261. '' => __( '— No Change —', 'woocommerce' ),
  262. 'no' => __( 'Do not allow', 'woocommerce' ),
  263. 'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
  264. 'yes' => __( 'Allow', 'woocommerce' )
  265. );
  266. foreach ( $options as $key => $value ) {
  267. echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
  268. }
  269. ?>
  270. </select>
  271. </span>
  272. </label>
  273. <?php endif; ?>
  274. <label>
  275. <span class="title"><?php esc_html_e( 'Sold Individually?', 'woocommerce' ); ?></span>
  276. <span class="input-text-wrap">
  277. <select class="sold_individually" name="_sold_individually">
  278. <?php
  279. $options = array(
  280. '' => __( '— No Change —', 'woocommerce' ),
  281. 'yes' => __( 'Yes', 'woocommerce' ),
  282. 'no' => __( 'No', 'woocommerce' )
  283. );
  284. foreach ( $options as $key => $value ) {
  285. echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
  286. }
  287. ?>
  288. </select>
  289. </span>
  290. </label>
  291. <?php do_action( 'woocommerce_product_bulk_edit_end' ); ?>
  292. <input type="hidden" name="woocommerce_bulk_edit" value="1" />
  293. <input type="hidden" name="woocommerce_bulk_edit_nonce" value="<?php echo wp_create_nonce( 'woocommerce_bulk_edit_nonce' ); ?>" />
  294. </div>
  295. </fieldset>