Removing Booking Offset and Window from Vendor account settings

Hi - we have the Booking availability set on a Vendor level and I want to hide the Booking Offset and Booking Window options from the vendor sign-up and Settings pages. The only script I found deals with this on a Listing level. Can you please send me the code snippet for Vendor level?

Thanks,
Candide

Hi,

Please use this PHP snippet - Hide the booking offset and window fields in the listing form #hivepress #bookings · GitHub
How to add custom code snippets - HivePress Help Center

​I hope this is helpful to you.

Hi Andriii - the solution you provided is for the Listing level which I already referred to. It doesn’t work when the Booking Offset and Window are set on a Vendor level. Can you please share what the snippet would be for Vendor forms instead?

Thanks
Candide

Hi,

I see. Please use this PHP snippet:

add_filter(
	'hivepress/v1/forms/vendor_update',
	function( $form ) {
		unset( $form['fields']['booking_offset'] );
		unset( $form['fields']['booking_window'] );

		return $form;
	},
	1000
);

Thank you that’s great - can I also hide the Minimum and Maximum booking duration from the same forms?

Thanks

Never mind I found the form field names:

add_filter(
	'hivepress/v1/forms/vendor_update',
	function( $form ) {
		unset( $form['fields']['booking_offset'] );
		unset( $form['fields']['booking_window'] );
        unset( $form['fields']['booking_min_length'] );
        unset( $form['fields']['booking_max_length'] );
		return $form;
	},
	1000
);

Thanks!

1 Like

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