WC_Settings_Products::get_settings_for_inventory_section()protectedWC 1.0

Get settings for the inventory section.

Method of the class: WC_Settings_Products{}

Hooks from the method

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_settings_for_inventory_section();

WC_Settings_Products::get_settings_for_inventory_section() code WC 8.7.0

protected function get_settings_for_inventory_section() {
	$settings =
		array(
			array(
				'title' => __( 'Inventory', 'woocommerce' ),
				'type'  => 'title',
				'desc'  => '',
				'id'    => 'product_inventory_options',
			),

			array(
				'title'   => __( 'Manage stock', 'woocommerce' ),
				'desc'    => __( 'Enable stock management', 'woocommerce' ),
				'id'      => 'woocommerce_manage_stock',
				'default' => 'yes',
				'type'    => 'checkbox',
			),

			array(
				'title'             => __( 'Hold stock (minutes)', 'woocommerce' ),
				'desc'              => __( 'Hold stock (for unpaid orders) for x minutes. When this limit is reached, the pending order will be cancelled. Leave blank to disable.', 'woocommerce' ),
				'id'                => 'woocommerce_hold_stock_minutes',
				'type'              => 'number',
				'custom_attributes' => array(
					'min'  => 0,
					'step' => 1,
				),
				'css'               => 'width: 80px;',
				'default'           => '60',
				'autoload'          => false,
				'class'             => 'manage_stock_field',
			),

			array(
				'title'         => __( 'Notifications', 'woocommerce' ),
				'desc'          => __( 'Enable low stock notifications', 'woocommerce' ),
				'id'            => 'woocommerce_notify_low_stock',
				'default'       => 'yes',
				'type'          => 'checkbox',
				'checkboxgroup' => 'start',
				'autoload'      => false,
				'class'         => 'manage_stock_field',
			),

			array(
				'desc'          => __( 'Enable out of stock notifications', 'woocommerce' ),
				'id'            => 'woocommerce_notify_no_stock',
				'default'       => 'yes',
				'type'          => 'checkbox',
				'checkboxgroup' => 'end',
				'autoload'      => false,
				'class'         => 'manage_stock_field',
			),

			array(
				'title'    => __( 'Notification recipient(s)', 'woocommerce' ),
				'desc'     => __( 'Enter recipients (comma separated) that will receive this notification.', 'woocommerce' ),
				'id'       => 'woocommerce_stock_email_recipient',
				'type'     => 'text',
				'default'  => get_option( 'admin_email' ),
				'css'      => 'width: 250px;',
				'autoload' => false,
				'desc_tip' => true,
				'class'    => 'manage_stock_field',
			),

			array(
				'title'             => __( 'Low stock threshold', 'woocommerce' ),
				'desc'              => __( 'When product stock reaches this amount you will be notified via email.', 'woocommerce' ),
				'id'                => 'woocommerce_notify_low_stock_amount',
				'css'               => 'width:50px;',
				'type'              => 'number',
				'custom_attributes' => array(
					'min'  => 0,
					'step' => 1,
				),
				'default'           => '2',
				'autoload'          => false,
				'desc_tip'          => true,
				'class'             => 'manage_stock_field',
			),

			array(
				'title'             => __( 'Out of stock threshold', 'woocommerce' ),
				'desc'              => __( 'When product stock reaches this amount the stock status will change to "out of stock" and you will be notified via email. This setting does not affect existing "in stock" products.', 'woocommerce' ),
				'id'                => 'woocommerce_notify_no_stock_amount',
				'css'               => 'width:50px;',
				'type'              => 'number',
				'custom_attributes' => array(
					'min'  => 0,
					'step' => 1,
				),
				'default'           => '0',
				'desc_tip'          => true,
				'class'             => 'manage_stock_field',
			),

			array(
				'title'   => __( 'Out of stock visibility', 'woocommerce' ),
				'desc'    => __( 'Hide out of stock items from the catalog', 'woocommerce' ),
				'id'      => 'woocommerce_hide_out_of_stock_items',
				'default' => 'no',
				'type'    => 'checkbox',
			),

			array(
				'title'    => __( 'Stock display format', 'woocommerce' ),
				'desc'     => __( 'This controls how stock quantities are displayed on the frontend.', 'woocommerce' ),
				'id'       => 'woocommerce_stock_format',
				'css'      => 'min-width:150px;',
				'class'    => 'wc-enhanced-select',
				'default'  => '',
				'type'     => 'select',
				'options'  => array(
					''           => __( 'Always show quantity remaining in stock e.g. "12 in stock"', 'woocommerce' ),
					'low_amount' => __( 'Only show quantity remaining in stock when low e.g. "Only 2 left in stock"', 'woocommerce' ),
					'no_amount'  => __( 'Never show quantity remaining in stock', 'woocommerce' ),
				),
				'desc_tip' => true,
			),

			array(
				'type' => 'sectionend',
				'id'   => 'product_inventory_options',
			),
		);

	return apply_filters( 'woocommerce_inventory_settings', $settings );
}