woocommerce_review_order_eligible_items filter-hookWC 10.9.0

Filter the eligible items considered when deciding whether the Customer Review Request email should fire for an order.

Same hook the page template, submission handler, and endpoint use, so all four entry points agree on the eligible-items set.

Usage

add_filter( 'woocommerce_review_order_eligible_items', 'wp_kama_woocommerce_review_order_eligible_items_filter', 10, 2 );

/**
 * Function for `woocommerce_review_order_eligible_items` filter-hook.
 * 
 * @param WC_Order_Item[] $items Order line items.
 * @param WC_Order        $order The order being inspected.
 *
 * @return WC_Order_Item[]
 */
function wp_kama_woocommerce_review_order_eligible_items_filter( $items, $order ){

	// filter...
	return $items;
}
$items(WC_Order_Item[])
Order line items.
$order(WC_Order)
The order being inspected.

Changelog

Since 10.9.0 Introduced.

Where the hook is called

ItemEligibility::has_actionable_items()
woocommerce_review_order_eligible_items
Endpoint::maybe_mark_no_actionable_rows()
woocommerce_review_order_eligible_items
SubmissionHandler::maybe_mark_order_complete()
woocommerce_review_order_eligible_items
SubmissionHandler::index_eligible_order_items()
woocommerce_review_order_eligible_items
woocommerce/src/Internal/OrderReviews/ItemEligibility.php 390
$items = (array) apply_filters( 'woocommerce_review_order_eligible_items', $order->get_items(), $order );
woocommerce/src/Internal/OrderReviews/Endpoint.php 582
$items = (array) apply_filters( 'woocommerce_review_order_eligible_items', $order->get_items(), $order );
woocommerce/src/Internal/OrderReviews/SubmissionHandler.php 310
$eligible_items = (array) apply_filters( 'woocommerce_review_order_eligible_items', $order->get_items(), $order );
woocommerce/src/Internal/OrderReviews/SubmissionHandler.php 400
$items = (array) apply_filters( 'woocommerce_review_order_eligible_items', $order->get_items(), $order );
woocommerce/templates/order/customer-review-order.php 33
$items = (array) apply_filters( 'woocommerce_review_order_eligible_items', $order->get_items(), $order );

Where the hook is used in WooCommerce

Usage not found.