WC_Product_Variation::get_manage_stock
Return if product manage stock.
Method of the class: WC_Product_Variation{}
No Hooks.
Returns
true|false|String. true, false, or parent.
Usage
$WC_Product_Variation = new WC_Product_Variation(); $WC_Product_Variation->get_manage_stock( $context );
- $context(string)
- What the value is for. Valid values are view and edit.
Default: 'view'
Changelog
| Since 3.0.0 | Introduced. |
WC_Product_Variation::get_manage_stock() WC Product Variation::get manage stock code WC 10.3.6
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;
}