/includes/admin/meta-boxes/views/html-product-data-inventory.php

  1. <div id="inventory_product_data" class="panel woocommerce_options_panel hidden"> 
  2.  
  3. <div class="options_group"> 
  4. <?php 
  5. if ( wc_product_sku_enabled() ) { 
  6. woocommerce_wp_text_input( array( 
  7. 'id' => '_sku',  
  8. 'value' => $product_object->get_sku( 'edit' ),  
  9. 'label' => '<abbr title="' . __( 'Stock Keeping Unit', 'woocommerce' ) . '">' . __( 'SKU', 'woocommerce' ) . '</abbr>',  
  10. 'desc_tip' => true,  
  11. 'description' => __( 'SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce' ),  
  12. ) ); 
  13.  
  14. do_action( 'woocommerce_product_options_sku' ); 
  15.  
  16. if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) { 
  17.  
  18. woocommerce_wp_checkbox( array( 
  19. 'id' => '_manage_stock',  
  20. 'value' => $product_object->get_manage_stock( 'edit' ) ? 'yes' : 'no',  
  21. 'wrapper_class' => 'show_if_simple show_if_variable',  
  22. 'label' => __( 'Manage stock?', 'woocommerce' ),  
  23. 'description' => __( 'Enable stock management at product level', 'woocommerce' ),  
  24. ) ); 
  25.  
  26. do_action( 'woocommerce_product_options_stock' ); 
  27.  
  28. echo '<div class="stock_fields show_if_simple show_if_variable">'; 
  29.  
  30. woocommerce_wp_text_input( array( 
  31. 'id' => '_stock',  
  32. 'value' => $product_object->get_stock_quantity( 'edit' ),  
  33. 'label' => __( 'Stock quantity', 'woocommerce' ),  
  34. 'desc_tip' => true,  
  35. 'description' => __( 'Stock quantity. If this is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.', 'woocommerce' ),  
  36. 'type' => 'number',  
  37. 'custom_attributes' => array( 
  38. 'step' => 'any',  
  39. ),  
  40. 'data_type' => 'stock',  
  41. ) ); 
  42.  
  43. woocommerce_wp_select( array( 
  44. 'id' => '_backorders',  
  45. 'value' => $product_object->get_backorders( 'edit' ),  
  46. 'label' => __( 'Allow backorders?', 'woocommerce' ),  
  47. 'options' => wc_get_product_backorder_options(),  
  48. 'desc_tip' => true,  
  49. 'description' => __( 'If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce' ),  
  50. ) ); 
  51.  
  52. do_action( 'woocommerce_product_options_stock_fields' ); 
  53.  
  54. echo '</div>'; 
  55.  
  56. woocommerce_wp_select( array( 
  57. 'id' => '_stock_status',  
  58. 'value' => $product_object->get_stock_status( 'edit' ),  
  59. 'wrapper_class' => 'hide_if_variable hide_if_external',  
  60. 'label' => __( 'Stock status', 'woocommerce' ),  
  61. 'options' => wc_get_product_stock_status_options(),  
  62. 'desc_tip' => true,  
  63. 'description' => __( 'Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce' ),  
  64. ) ); 
  65.  
  66. do_action( 'woocommerce_product_options_stock_status' ); 
  67. ?> 
  68. </div> 
  69.  
  70. <div class="options_group show_if_simple show_if_variable"> 
  71. <?php 
  72. woocommerce_wp_checkbox( array( 
  73. 'id' => '_sold_individually',  
  74. 'value' => $product_object->get_sold_individually( 'edit' ) ? 'yes' : 'no',  
  75. 'wrapper_class' => 'show_if_simple show_if_variable',  
  76. 'label' => __( 'Sold individually', 'woocommerce' ),  
  77. 'description' => __( 'Enable this to only allow one of this item to be bought in a single order', 'woocommerce' ),  
  78. ) ); 
  79.  
  80. do_action( 'woocommerce_product_options_sold_individually' ); 
  81. ?> 
  82. </div> 
  83.  
  84. <?php do_action( 'woocommerce_product_options_inventory_product_data' ); ?> 
  85. </div> 
.