Booking form modify by category

Hello,

I am trying to disable the date range on the booking form for one of my listing categories.

image

I wrote the following code and it works without the if condition, with the if condition, as it is below, it doesn’t work at all.
Any ideas how to modify that to unset only for the ‘custom_category’?
Thank you in advance to anyone that can help out.

add_filter('hivepress/v1/forms/booking_make', 'form_mod1', 1000);
				   
function form_mod1( $form ) {

               if(is_tax( 'hp_listing_category', 'custom_category' )){		

		           unset( $form['fields']['_dates'] );			
		
	}
		
		return $form;
}

Hi,

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: https://fvrr.co/32e7LvY
As a workaround, you can limit booking categories using this doc: How to restrict booking to specific listing categories - HivePress Help Center. After that, all categories that are not added to the booking categories will be sold through the Marketplace, and the date will disappear accordingly. As for the guests function, you can use the quantity function for Marketplace, you can enable it in HivePress > Listings.

Hi,

Sorry, there’s no simple code snippet for this, it would require a custom implementation.

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