0.00  View cart

Support Easy Booking: Availability Check [Resolved] easy_booking_availability_remove_passed_dates

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8153
    chicho_zar
    Participant

    Hi Ashanna, I’m having a problem with the easy_booking_availability_remove_passed_dates() function.
    I have a booking system for several products but it’s really only one and through a function you passed to me at the time I can block the booking of a day for several products at once. Example: if I book with the product (morning), the reservation of the day of the product (morning and afternoon) is blocked, and also the reservation of the product (full day) is blocked. Since we only have one location.
    I have the problem that when I update an order, the calendars are not working properly, I have to press the “initialize availability” button every time I update the order so that the calendars work.
    So I tried to ponder this function:

    // define the woocommerce_update_order callback
    function iglu_action_woocommerce_update_order( $order_get_id ) {

    easy_booking_availability_remove_passed_dates();

    };

    // add the action
    add_action( ‘woocommerce_update_order’, ‘iglu_action_woocommerce_update_order’, 12, 1 );

    The result is always a server error. Can you think of a way to make the function that generates the “initialize availability” button run after updating an order?

    Thank you very much for your help

    #8155
    Ashanna
    Plugin's author

    Hello,

    I don’t remember what I told you. Could you remind me what function I gave you?

    Please note that in Availability Check, easy_booking_availability_remove_passed_dates is not a function but an action hook.

    So based on what you did, you should do this instead:

    // define the woocommerce_update_order callback
    function iglu_action_woocommerce_update_order( $order_get_id ) {
    
    	do_action( 'easy_booking_availability_remove_passed_dates' );
    
    };
    
    // add the action
    add_action( 'woocommerce_update_order', 'iglu_action_woocommerce_update_order', 12, 1 );

    But it shouldn’t be necessary, because availabilities should be updated when saving an order. Is it a variable product? Do you have the latest version of Availability Check (1.6.15)?

    Regards,
    Natasha

    #8161
    chicho_zar
    Participant

    ohhh! thanks a lot this works for me, i don’t know why i didn’t put the do_action().

    This was one thing that was driving us crazy.

    Again, thank you very much.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘[Resolved] easy_booking_availability_remove_passed_dates’ is closed to new replies.

Want to know what's next with Easy Booking? Check the roadmap!