Hivepress Rental Hive booking days option

Hi want to make the ‘Booking Days (optional)’ into a required field instead of optional field so users have to select days they are available for booking. Loco translate wont change in being an optional field.

Please try this PHP snippet

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if(isset($form['fields']['booking_days'])){
		  $form['fields']['booking_days']['required'] = true;
		}

		return $form;
	},
	1000
);

yevhen thank you, how do i add a PHP snippet exactly, any tutorials? do i just copy and paste PHP snippet into appearance - theme editor. Not exactly sure how to use PHP snippet

Please check this tutorial How to add custom code snippets - HivePress Help Center

Have downloaded code snippet plugin and installed, snippets - add new -copy and pasted above PHP snippet and saved and activated. Not sure why but still says book days (optional) rather than making it a required field in ‘list a property’ settings.

If you mean that it is optional when you add a new listing then please make sure that you correctly copy/put this code snippet. It has been tested locally and it seems to be ok

Not sure why i have copy and pasted PHP snippet into code snippet plugin but still the same. I have used loco translate to translate into Booking days (*required) instead. Many thanks yevhen for your help and expertise much appreciated.

Please also make sure that the site front-end is not cached (then changes may not be reflected immediately after you add a custom snippet). If you resolved this via Loco translate that is ok, it is another workaround but it may affect other labels with the same text.
Hope this helps.

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