• Resolved emirelali

    (@emirelali)


    Hello,

    I have created a woocommerce booking website for my new yoga studio.

    When clients choose to make a new booking by paying “Cash on Delivery” the booking status is automatically set to unpaid.

    However, I would like to automatically set it to “confirmed”.

    I have tried to add custom code to my functions.php file but they don’t work.

    add_action( 'woocommerce_new_booking', 'auto_confirm_cod_bookings', 10, 1 );

    function auto_confirm_cod_bookings( $booking_id ) {
    $booking = new WC_Booking( $booking_id );
    $order = $booking->get_order();

    if ( $order && $order->get_payment_method() === 'cod' ) {
    // Change status to confirmed
    $booking->update_status( 'confirmed' );
    }
    }
Viewing 1 replies (of 1 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    Thanks for getting in touch; This forum is only focused on the core features of the WooCommerce plugin itself. For more help in changing the booking status automatically, please get in touch with the developers of your bookings plugin directly as it’s not something that the core WooCommerce plugin would have any direct control over.

Viewing 1 replies (of 1 total)
  • The topic ‘Automatically set new booking status to confirmed’ is closed to new replies.