• Resolved sibichan

    (@sibichan)


    Now Check Availability This Room button showing in single page before the slide.

    How to add below all content ? Is there any short code?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Lee

    (@leehld)

    Hello @sibichan,

    The Now Check Availability This Room button was hooked in before of single room page, if you want to add it below all content, you can use CSS code or override template to move it down.

    Best Regards,

    Lee

    Thread Starter sibichan

    (@sibichan)

    How to override template to move it down and where is the code located ?

    Plugin Contributor Lee

    (@leehld)

    Oh, I mean you need override hook in the addon.

    Currently WP Hotel Booking Room add-on hooks into “hotel_booking_single_room_title” to add Check Availability This Room button on top. You need remove this action in “hotel_booking_single_room_title” and add to hooks below in single room.

    http://prntscr.com/iv5m5n
    http://prntscr.com/iv5nh3

    Best regards,

    Lee

    Thread Starter sibichan

    (@sibichan)

    What is the name and location of file you opened here at https://prnt.sc/iv5nh3

    Thread Starter sibichan

    (@sibichan)

    wp-content/plugins/wp-hotel-booking/templates/content-single-room.php . Right ?

    Plugin Contributor Lee

    (@leehld)

    Yes, wp-hotel-booking/templates/content-single-room.php

    Thread Starter sibichan

    (@sibichan)

    Copied the code from wp-content/plugins/wp-hotel-booking-booking-room/inc/class-hb-booking-room.php and added like below to

    wp-content/plugins/wp-hotel-booking/templates/content-single-room.php

    <?php add_action( 'hotel_booking_single_room_title', array( $this, 'single_add_button' ), 9 );?>

    Above code added after

    <?php do_action( 'hotel_booking_after_single_product' ); ?>

    But in single room page, button is not showing.

    Already ticked in WP hotel booking > Settings > Enable book in single room

    • This reply was modified 8 years ago by sibichan.
    Plugin Contributor Lee

    (@leehld)

    No, It looks like you do not know how to remove hook and add it into other. In this case, if you want, please reply forum topic. I will access and config for you.

    Thread Starter sibichan

    (@sibichan)

    Just modify the files from your end and send me

    Plugin Contributor Lee

    (@leehld)

    Add this code in “functions.php” file in your theme.

    if ( class_exists( 'WP_Hotel_Booking_Room_Extenstion' ) ) {
    	$booking_room = WP_Hotel_Booking_Room_Extenstion::instance();
    
    	remove_action( 'hotel_booking_single_room_title', array( $booking_room, 'single_add_button' ), 9 );
    	add_action( 'hotel_booking_single_room_gallery', array( $booking_room, 'single_add_button' ), 20 );
    }

    You can replace “hotel_booking_single_room_gallery” below to any hook in “content-single-room.php” as i said.

    Plugin Contributor Lee

    (@leehld)

    Any news? @sibichan

    Thread Starter sibichan

    (@sibichan)

    Thank you very much. Now its showing below the gallery. But when i click the button, booking form showing outside of the template

    Plugin Contributor Lee

    (@leehld)

    Ok @sibichan, We will update layout templates soon.

    Hello Lee,

    Please, modify the line code you typed in your comment to move the addon hook, the ones must be added on functions.php file theme.

    Correct code line is as follow:

    if ( class_exists( ‘WP_Hotel_Booking_Room_Extension’ ) ) {
    $booking_room = WP_Hotel_Booking_Room_Extension::instance();

    remove_action( ‘hotel_booking_single_room_title’, array( $booking_room, ‘single_add_button’ ), 9 );
    add_action( ‘hotel_booking_single_room_gallery’, array( $booking_room, ‘single_add_button’ ), 20 );
    }
    I wasted a while trying to make it works until I discover the mistake at “Extenstion”

    Kind regards

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Check Availability This Room button position’ is closed to new replies.