Woocommerce cart deposit

I have this code for Woocommerce orders, basically a deposit fee per order. But the customer should only be able to pay this fee and the rest later. There are heaps of solutions for product based deposit fees, but not per cart. Any ideas, thoughts on how to force this on checkout and the rest later?

add_action( 'woocommerce_cart_calculate_fees', 'booking_fee' );
function booking_fee() {
    global $woocommerce;

    if ( is_admin() && ! defined( 'DOING_AJAX' ) )
        return;

 $bookingfee_array = array( '2434' );

    $fixed = 40.00;

    foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {

        if( in_array( $values['product_id'], $bookingfee_array ) ) {
            $surcharge = $fixed;
            $woocommerce->cart->add_fee( 'Broneeringutasu', $surcharge, true, '' );
        }

    }

}

Related posts