Indicate instant booking for listings

Hi HivePress Team,

Would it be possible to add “Instant booking” automatically to the main picture of a property listing (pic. 1) when hosts don’t choose the option “Manually accept new bookings” (pic. 2)?
Would be great to have it on the upper right corner. I don’t like to mix it together with categories (pic. 3) as it looks quite unprofessional.

Thank you.

2022-12-12 (2)

2022-12-12 (4)

2022-12-12 (6)

Thanks for your suggestion, we’ll consider adding this feature (in addition to changing the booking button label). It may be possible already, but requires a few code changes.

1 Like

Hi Ihor, any update on that?
Thank you.

1 Like

Sorry for the confusion - we will consider adding this change but it’s not guaranteed, roadmap features get the “approved” tag. If it helps we can provide some guidance on adding the “instant booking” badge with the code customizations, let me know if it’s ok.

Thank you Ihor,

I can try to use your guidance, but I am a newbe, so I hope I will be able to do it.

Please try this PHP snippet to start but please note that it can require further customization. If you are not familiar with the code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY

add_filter(
	'hivepress/v1/templates/listing_view_block/blocks',
	function($blocks, $template){
		$listing = $template->get_context('listing');
		
		if(!$listing || $listing->get_booking_moderated()){
			return $blocks;
		}
		
		return hivepress()->template->merge_blocks(
			$blocks,
			[
				'listing_header' => [
					'blocks' => [
						'custom_block_t' => [
							'type' => 'content',
							'content' => 'Instant booking',
							'_order' => 5,
						],
					],
				],
			],
		);
	},
	1000,
	2
);
1 Like

Thanks for this code, is it possible to make it a tag the same way as “apartments” etc.

Thank you Yevhen, it works. But, as you said, it will need some custom work to make it look a bit nicer.

Yes, it is possible but requires advanced CSS customization

Hi Yevhen,

Would it be possible to create similar snippet for “Booking upon request”, so it will look the same as the “Instant booking”?

Thank you Yevhen.

Sorry, this requires further customizations. I recommend using the suggested code snippet above to insert a HTML code with the “Instant booking” badge and then style it via CSS.