Check Availability This Room button position
-
Now Check Availability This Room button showing in single page before the slide.
How to add below all content ? Is there any short code?
-
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
How to override template to move it down and where is the code located ?
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/iv5nh3Best regards,
Lee
What is the name and location of file you opened here at https://prnt.sc/iv5nh3
wp-content/plugins/wp-hotel-booking/templates/content-single-room.php . Right ?
Yes, wp-hotel-booking/templates/content-single-room.php
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.
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.
Just modify the files from your end and send me
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.
Any news? @sibichan
Thank you very much. Now its showing below the gallery. But when i click the button, booking form showing outside of the template
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
-
This reply was modified 8 years ago by
The topic ‘Check Availability This Room button position’ is closed to new replies.