WordPress at a glance
function is not described


ProductCountRuleProcessor::process() public WC 1.0

Performs a comparison operation against the number of products.

{} It's a method of the class: ProductCountRuleProcessor{}

No Hooks.


true|false. The result of the operation.


$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.

Code of ProductCountRuleProcessor::process() WC 5.3.0

public function process( $rule, $stored_state ) {
	$products          = $this->product_query->get_products();
	$new_product_count = property_exists( $stored_state, 'new_product_count' )
		? $stored_state->new_product_count
		: 0;
	$count             = $products->total + $new_product_count;

	return ComparisonOperation::compare(