nan91
October 27, 2022, 7:54am
1
Hi!
I would like to ask whether is it possible to do that. So I want to allow only the featured listings to have a booking/reservation button but. Are there any methods/snippet to prevent booking or hide the button from the “normal listings”. Or any ways how to do that?
Thank you for the reply.
Vasiliy
October 27, 2022, 10:59am
4
Good day!
Here is a code snippet to show the booking block in features listing pages.
add_filter('hivepress/v1/templates/listing_view_page/blocks', function ($blocks, $template) {
$listing = $template->get_context('listing');
if (!$listing || $listing->get_featured()) {
return $blocks;
}
hivepress()->template->fetch_blocks($blocks, ['booking_make_form']);
return $blocks;
}, 1000, 2);
1 Like
nan91
October 27, 2022, 12:56pm
5
Thank you for the reply!
Sorry but I cannot try at this moment because I don’t have bookings plugin yet. If it works 100% I will buy the addon.
1 Like
ihor
October 27, 2022, 5:16pm
7
Yes, the code snippet above removes the booking form if the listing is not featured.
system
Closed
November 26, 2022, 5:17pm
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.