Automattic\WooCommerce\Admin\API

ProductsLowInStock::is_using_sitewide_stock_threshold_only()protectedWC 1.0

Check to see if store is using sitewide threshold only. Meaning that it does not have any custom stock threshold for a product.

{} Это метод класса: ProductsLowInStock{}

Хуков нет.

Возвращает

true|false.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->is_using_sitewide_stock_threshold_only();

Код ProductsLowInStock::is_using_sitewide_stock_threshold_only() WC 6.6.1

protected function is_using_sitewide_stock_threshold_only() {
	global $wpdb;
	$count = $wpdb->get_var( "select count(*) as total from {$wpdb->postmeta} where meta_key='_low_stock_amount'" );
	return 0 === (int) $count;
}