woocommerce_cart_needs_payment filter-hookWC 1.0

Note that woocommerce_cart_needs_payment is only used in WC_Checkout::process_checkout() to keep backwards compatibility. Use woocommerce_order_needs_payment instead.

Note that at this point you can't rely on the Cart Object anymore, since it could be empty see: https://github.com/woocommerce/woocommerce/issues/24631

Usage

add_filter( 'woocommerce_cart_needs_payment', 'wp_kama_woocommerce_cart_needs_payment_filter', 10, 2 );

/**
 * Function for `woocommerce_cart_needs_payment` filter-hook.
 * 
 * @param  $needs_payment 
 * @param  $WC()->cart    
 *
 * @return 
 */
function wp_kama_woocommerce_cart_needs_payment_filter( $needs_payment, $WC()->cart ){

	// filter...
	return $needs_payment;
}
$needs_payment
-
$WC()->cart
-

Where the hook is called

WC_Checkout::process_checkout()
woocommerce_cart_needs_payment
WC_Cart::needs_payment()
woocommerce_cart_needs_payment
woocommerce/includes/class-wc-checkout.php 1205
if ( apply_filters( 'woocommerce_cart_needs_payment', $order->needs_payment(), WC()->cart ) ) {
woocommerce/includes/class-wc-cart.php 1409
return apply_filters( 'woocommerce_cart_needs_payment', 0 < $this->get_total( 'edit' ), $this );

Where the hook is used in WooCommerce

Usage not found.