* * @param int $loop * @param array $variation_data * @param WP_Post $variation */ do_action('woocommerce_variation_options_pricing', $loop, $variation_data, $variation); ?> </div> <?php if ('yes' === get_option('woocommerce_manage_stock')) { ?> <div class="show_if_variation_manage_stock" style="display: none;"> <?php woocommerce_wp_text_input(array('id' => "variable_stock{$loop}", 'name' => "variable_stock[{$loop}]", 'value' => $variation_object->get_stock_quantity('edit'), 'label' => __('Stock quantity', 'woocommerce'), 'desc_tip' => true, 'description' => __('Enter a quantity to enable stock management at variation level, or leave blank to use the parent product\'s options.', 'woocommerce'), 'type' => 'number', 'custom_attributes' => array('step' => 'any'), 'data_type' => 'stock', 'wrapper_class' => 'form-row form-row-first')); woocommerce_wp_select(array('id' => "variable_backorders{$loop}", 'name' => "variable_backorders[{$loop}]", 'value' => $variation_object->get_backorders('edit'), 'label' => __('Allow backorders?', 'woocommerce'), 'options' => wc_get_product_backorder_options(), 'desc_tip' => true, 'description' => __('If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce'), 'wrapper_class' => 'form-row form-row-last')); /** * woocommerce_variation_options_inventory action. * * @since 2.5.0 * * @param int $loop * @param array $variation_data * @param WP_Post $variation */ do_action('woocommerce_variation_options_inventory', $loop, $variation_data, $variation); ?> </div> <?php } ?>
</label> <?php } ?> </div> <label class="alignleft"> <span class="title"><?php _e('Backorders?', 'woocommerce'); ?> </span> <span class="input-text-wrap"> <select class="backorders" name="_backorders"> <?php foreach (wc_get_product_backorder_options() as $key => $value) { echo '<option value="' . esc_attr($key) . '">' . $value . '</option>'; } ?> </select> </span> </label> <?php do_action('woocommerce_product_quick_edit_end'); ?> <input type="hidden" name="woocommerce_quick_edit" value="1" /> <input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo wp_create_nonce('woocommerce_quick_edit_nonce'); ?>
<div id="inventory_product_data" class="panel woocommerce_options_panel hidden"> <div class="options_group"> <?php if (wc_product_sku_enabled()) { woocommerce_wp_text_input(array('id' => '_sku', 'value' => $product_object->get_sku('edit'), 'label' => '<abbr title="' . __('Stock Keeping Unit', 'woocommerce') . '">' . __('SKU', 'woocommerce') . '</abbr>', 'desc_tip' => true, 'description' => __('SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce'))); } do_action('woocommerce_product_options_sku'); if ('yes' === get_option('woocommerce_manage_stock')) { woocommerce_wp_checkbox(array('id' => '_manage_stock', 'value' => $product_object->get_manage_stock('edit') ? 'yes' : 'no', 'wrapper_class' => 'show_if_simple show_if_variable', 'label' => __('Manage stock?', 'woocommerce'), 'description' => __('Enable stock management at product level', 'woocommerce'))); do_action('woocommerce_product_options_stock'); echo '<div class="stock_fields show_if_simple show_if_variable">'; woocommerce_wp_text_input(array('id' => '_stock', 'value' => $product_object->get_stock_quantity('edit'), 'label' => __('Stock quantity', 'woocommerce'), 'desc_tip' => true, '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'), 'type' => 'number', 'custom_attributes' => array('step' => 'any'), 'data_type' => 'stock')); woocommerce_wp_select(array('id' => '_backorders', 'value' => $product_object->get_backorders('edit'), 'label' => __('Allow backorders?', 'woocommerce'), 'options' => wc_get_product_backorder_options(), 'desc_tip' => true, 'description' => __('If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce'))); do_action('woocommerce_product_options_stock_fields'); echo '</div>'; } woocommerce_wp_select(array('id' => '_stock_status', 'value' => $product_object->get_stock_status('edit'), 'wrapper_class' => 'hide_if_variable hide_if_external', 'label' => __('Stock status', 'woocommerce'), 'options' => wc_get_product_stock_status_options(), 'desc_tip' => true, 'description' => __('Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce'))); do_action('woocommerce_product_options_stock_status'); ?> </div> <div class="options_group show_if_simple show_if_variable"> <?php woocommerce_wp_checkbox(array('id' => '_sold_individually', 'value' => $product_object->get_sold_individually('edit') ? 'yes' : 'no', 'wrapper_class' => 'show_if_simple show_if_variable', 'label' => __('Sold individually', 'woocommerce'), 'description' => __('Enable this to only allow one of this item to be bought in a single order', 'woocommerce'))); do_action('woocommerce_product_options_sold_individually'); ?> </div> <?php do_action('woocommerce_product_options_inventory_product_data');