woocommerce_order_is_partially_refunded
Trigger notification emails.
Filter hook to modify the partially-refunded status conditions.
Usage
add_filter( 'woocommerce_order_is_partially_refunded', 'wp_kama_woocommerce_order_is_partially_refunded_filter', 10, 3 );
/**
* Function for `woocommerce_order_is_partially_refunded` filter-hook.
*
* @param bool $is_partially_refunded Whether the order is partially refunded.
* @param int $order_id The order id.
* @param int $refund_id The refund id.
*
* @return bool
*/
function wp_kama_woocommerce_order_is_partially_refunded_filter( $is_partially_refunded, $order_id, $refund_id ){
// filter...
return $is_partially_refunded;
}
- $is_partially_refunded(true|false)
- Whether the order is partially refunded.
- $order_id(int)
- The order id.
- $refund_id(int)
- The refund id.
Changelog
| Since 6.7.0 | Introduced. |
Where the hook is called
woocommerce_order_is_partially_refunded
woocommerce_order_is_partially_refunded
woocommerce/includes/wc-order-functions.php 708-714
if ( (bool) apply_filters(
'woocommerce_order_is_partially_refunded',
( $remaining_refund_amount - $args['amount'] ) > 0 ||
( ! empty( $args['line_items'] ) && $order->has_free_item() && ( $remaining_refund_items - $refund_item_count ) > 0 ),
$order->get_id(),
$refund->get_id()
) ) {
woocommerce/src/Internal/Orders/OrderActionsRestController.php 763-768
$partially_refunded = apply_filters( 'woocommerce_order_is_partially_refunded', count( $refunds ) > 0 && ( $remaining_amount > 0 || ( $order->has_free_item() && $remaining_items > 0 ) ), $order->get_id(), $last_refund ? $last_refund->get_id() : 0 );