Automattic\WooCommerce\Admin\RemoteInboxNotifications

ProductCountRuleProcessor::process()publicWC 1.0

Performs a comparison operation against the number of products.

Method of the class: ProductCountRuleProcessor{}

No Hooks.

Return

true|false. The result of the operation.

Usage

$ProductCountRuleProcessor = new ProductCountRuleProcessor();
$ProductCountRuleProcessor->process( $rule, $stored_state );
$rule(object) (required)
The specific rule being processed by this rule processor.
$stored_state(object) (required)
Stored state.

ProductCountRuleProcessor::process() code WC 7.1.0

public function process( $rule, $stored_state ) {
	$products = $this->product_query->get_products();

	return ComparisonOperation::compare(
		$products->total,
		$rule->value,
		$rule->operation
	);
}