Change "Request to Book" link for a category

I would like to disable the “Request to Book” section for a single category. Could you share the code I would need to replace the “Request to Book” section with a single button so that I can have a link to a form?

For example on this website I want the “Printed Directory” category listings to have the booking option disabled and instead have a button that says “order directory” and the button link to be:

You want to redirect users to an external link when users click on Request to Book on the listing, which has some category. Am I correctly understanding you?

Yes, I want to direct users to an external link and change the button text to “Order Directory”

Thank you for your help!

Thank you for waiting. Please try this PHP code snippet. Unfortunately, changing the link for the booking make form is impossible. But as another solution, it is possible to hide the booking make form and show the button with a link instead. Please change 1,2,3 on the categories id where you want to use this functionality.

	function($blocks, $template){
		$listing = $template->get_context('listing');
		if(!$listing || !$listing->is_booking_moderated() || !array_intersect([1,2,3], (array)$listing->get_categories__id())){
			return $blocks;
		hivepress()->template->fetch_block($blocks, 'booking_make_form');
		return hivepress()->template->merge_blocks(
				'page_sidebar' => [
					'blocks' => [
						'custom_booking_order_direct' => [
							'type' => 'content',
							'content' => '<a target="_blank" class="button button--large button--primary hp-button--wide" href="put your link here">Custom text</a>',
							'_order' => 15,

This was VERY helpful! Thank you. Could you show me the code with some padding added to the bottom of the button?


Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.