woocommerce_cart_needs_payment

woocommerce_cart_needs_payment

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_cart_needs_payment') is found 2 times:

  • /includes/class-wc-cart.php line 1434
    1430
    1431
    1432
    1433
    1434
    1435
    1436
    1437
    1438
    1439
    *
     * @return bool
     */
    public function needs_payment() {
        return apply_filters( 'woocommerce_cart_needs_payment', 0 < $this->get_total( 'edit' ), $this );
    }
     
    /*
     * Shipping related functions.
     */
  • /includes/class-wc-checkout.php line 1324
    1320
    1321
    1322
    1323
    1324
    1325
    1326
    1327
    1328
    1329
    1330
             * since it could be empty see:
             * https://github.com/woocommerce/woocommerce/issues/24631
             */
     
            if ( apply_filters( 'woocommerce_cart_needs_payment', $order->needs_payment(), WC()->cart ) ) {
                $this->process_order_payment( $order_id, $posted_data['payment_method'] );
            } else {
                $this->process_order_without_payment( $order_id );
            }
        }
    } catch ( Exception $e ) {