WC_Product_Variation::get_manage_stock( string $context = 'view' )

Return if product manage stock.


Description Description


Parameters Parameters

$context

(Optional) What the value is for. Valid values are view and edit.

Default value: 'view'


Top ↑

Return Return

(boolean|string) true, false, or parent.


Top ↑

Source Source

File: includes/class-wc-product-variation.php

	public function get_manage_stock( $context = 'view' ) {
		$value = $this->get_prop( 'manage_stock', $context );

		// Inherit value from parent.
		if ( 'view' === $context && false === $value && true === wc_string_to_bool( $this->parent_data['manage_stock'] ) ) {
			$value = 'parent';
		}
		return $value;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.