html-quick-edit-product.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <?php
  2. /**
  3. * Admin View: Quick Edit Product
  4. *
  5. * @package admin.
  6. */
  7. defined( 'ABSPATH' ) || exit;
  8. ?>
  9. <fieldset class="inline-edit-col-left">
  10. <div id="woocommerce-fields" class="inline-edit-col">
  11. <h4><?php esc_html_e( 'Product data', 'woocommerce' ); ?></h4>
  12. <?php do_action( 'woocommerce_product_quick_edit_start' ); ?>
  13. <?php if ( wc_product_sku_enabled() ) : ?>
  14. <label>
  15. <span class="title"><?php esc_html_e( 'SKU', 'woocommerce' ); ?></span>
  16. <span class="input-text-wrap">
  17. <input type="text" name="_sku" class="text sku" value="">
  18. </span>
  19. </label>
  20. <br class="clear" />
  21. <?php endif; ?>
  22. <div class="price_fields">
  23. <label>
  24. <span class="title"><?php esc_html_e( 'Price', 'woocommerce' ); ?></span>
  25. <span class="input-text-wrap">
  26. <input type="text" name="_regular_price" class="text wc_input_price regular_price" placeholder="<?php esc_attr_e( 'Regular price', 'woocommerce' ); ?>" value="">
  27. </span>
  28. </label>
  29. <br class="clear" />
  30. <label>
  31. <span class="title"><?php esc_html_e( 'Sale', 'woocommerce' ); ?></span>
  32. <span class="input-text-wrap">
  33. <input type="text" name="_sale_price" class="text wc_input_price sale_price" placeholder="<?php esc_attr_e( 'Sale price', 'woocommerce' ); ?>" value="">
  34. </span>
  35. </label>
  36. <br class="clear" />
  37. </div>
  38. <?php if ( wc_tax_enabled() ) : ?>
  39. <label class="alignleft">
  40. <span class="title"><?php esc_html_e( 'Tax status', 'woocommerce' ); ?></span>
  41. <span class="input-text-wrap">
  42. <select class="tax_status" name="_tax_status">
  43. <?php
  44. $options = array(
  45. 'taxable' => __( 'Taxable', 'woocommerce' ),
  46. 'shipping' => __( 'Shipping only', 'woocommerce' ),
  47. 'none' => _x( 'None', 'Tax status', 'woocommerce' ),
  48. );
  49. foreach ( $options as $key => $value ) {
  50. echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
  51. }
  52. ?>
  53. </select>
  54. </span>
  55. </label>
  56. <br class="clear" />
  57. <label class="alignleft">
  58. <span class="title"><?php esc_html_e( 'Tax class', 'woocommerce' ); ?></span>
  59. <span class="input-text-wrap">
  60. <select class="tax_class" name="_tax_class">
  61. <?php
  62. $options = array(
  63. '' => __( 'Standard', 'woocommerce' ),
  64. );
  65. $tax_classes = WC_Tax::get_tax_classes();
  66. if ( ! empty( $tax_classes ) ) {
  67. foreach ( $tax_classes as $class ) {
  68. $options[ sanitize_title( $class ) ] = esc_html( $class );
  69. }
  70. }
  71. foreach ( $options as $key => $value ) {
  72. echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
  73. }
  74. ?>
  75. </select>
  76. </span>
  77. </label>
  78. <br class="clear" />
  79. <?php endif; ?>
  80. <?php if ( wc_product_weight_enabled() || wc_product_dimensions_enabled() ) : ?>
  81. <div class="dimension_fields">
  82. <?php if ( wc_product_weight_enabled() ) : ?>
  83. <label>
  84. <span class="title"><?php esc_html_e( 'Weight', 'woocommerce' ); ?></span>
  85. <span class="input-text-wrap">
  86. <input type="text" name="_weight" class="text weight" placeholder="<?php echo esc_attr( wc_format_localized_decimal( 0 ) ); ?>" value="">
  87. </span>
  88. </label>
  89. <br class="clear" />
  90. <?php endif; ?>
  91. <?php if ( wc_product_dimensions_enabled() ) : ?>
  92. <div class="inline-edit-group dimensions">
  93. <div>
  94. <span class="title"><?php esc_html_e( 'L/W/H', 'woocommerce' ); ?></span>
  95. <span class="input-text-wrap">
  96. <input type="text" name="_length" class="text wc_input_decimal length" placeholder="<?php esc_attr_e( 'Length', 'woocommerce' ); ?>" value="">
  97. <input type="text" name="_width" class="text wc_input_decimal width" placeholder="<?php esc_attr_e( 'Width', 'woocommerce' ); ?>" value="">
  98. <input type="text" name="_height" class="text wc_input_decimal height" placeholder="<?php esc_attr_e( 'Height', 'woocommerce' ); ?>" value="">
  99. </span>
  100. </div>
  101. </div>
  102. <?php endif; ?>
  103. </div>
  104. <?php endif; ?>
  105. <div class="inline-edit-group">
  106. <span class="title"><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></span>
  107. <span class="input-text-wrap">
  108. <select class="shipping_class" name="_shipping_class">
  109. <option value="_no_shipping_class"><?php esc_html_e( 'No shipping class', 'woocommerce' ); ?></option>
  110. <?php
  111. foreach ( $shipping_class as $key => $value ) {
  112. echo '<option value="' . esc_attr( $value->slug ) . '">' . esc_html( $value->name ) . '</option>';
  113. }
  114. ?>
  115. </select>
  116. </span>
  117. </div>
  118. <div class="inline-edit-group">
  119. <label class="alignleft">
  120. <span class="title"><?php esc_html_e( 'Visibility', 'woocommerce' ); ?></span>
  121. <span class="input-text-wrap">
  122. <select class="visibility" name="_visibility">
  123. <?php
  124. $options = apply_filters(
  125. 'woocommerce_product_visibility_options', array(
  126. 'visible' => __( 'Catalog &amp; search', 'woocommerce' ),
  127. 'catalog' => __( 'Catalog', 'woocommerce' ),
  128. 'search' => __( 'Search', 'woocommerce' ),
  129. 'hidden' => __( 'Hidden', 'woocommerce' ),
  130. )
  131. );
  132. foreach ( $options as $key => $value ) {
  133. echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
  134. }
  135. ?>
  136. </select>
  137. </span>
  138. </label>
  139. <label class="alignleft featured">
  140. <input type="checkbox" name="_featured" value="1">
  141. <span class="checkbox-title"><?php esc_html_e( 'Featured', 'woocommerce' ); ?></span>
  142. </label>
  143. </div>
  144. <?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?>
  145. <div class="inline-edit-group manage_stock_field">
  146. <label class="manage_stock">
  147. <input type="checkbox" name="_manage_stock" value="1">
  148. <span class="checkbox-title"><?php esc_html_e( 'Manage stock?', 'woocommerce' ); ?></span>
  149. </label>
  150. </div>
  151. <?php endif; ?>
  152. <label class="stock_status_field">
  153. <span class="title"><?php esc_html_e( 'In stock?', 'woocommerce' ); ?></span>
  154. <span class="input-text-wrap">
  155. <select class="stock_status" name="_stock_status">
  156. <?php
  157. foreach ( wc_get_product_stock_status_options() as $key => $value ) {
  158. echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
  159. }
  160. ?>
  161. </select>
  162. </span>
  163. </label>
  164. <div class="stock_fields">
  165. <?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?>
  166. <label class="stock_qty_field">
  167. <span class="title"><?php esc_html_e( 'Stock qty', 'woocommerce' ); ?></span>
  168. <span class="input-text-wrap">
  169. <input type="number" name="_stock" class="text stock" step="any" value="">
  170. </span>
  171. </label>
  172. <?php endif; ?>
  173. </div>
  174. <label class="alignleft backorder_field">
  175. <span class="title"><?php esc_html_e( 'Backorders?', 'woocommerce' ); ?></span>
  176. <span class="input-text-wrap">
  177. <select class="backorders" name="_backorders">
  178. <?php
  179. foreach ( wc_get_product_backorder_options() as $key => $value ) {
  180. echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
  181. }
  182. ?>
  183. </select>
  184. </span>
  185. </label>
  186. <?php do_action( 'woocommerce_product_quick_edit_end' ); ?>
  187. <input type="hidden" name="woocommerce_quick_edit" value="1" />
  188. <input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo esc_attr( wp_create_nonce( 'woocommerce_quick_edit_nonce' ) ); ?>" />
  189. </div>
  190. </fieldset>