How to remove "minimum guests per booking" as an option and set it all to 1?

When I click on “list a property”, it asks me to set “minimum guests per booking”. How do I remove this option in the “list a property” page and how do I set every listing to 1 as minimum guests per booking? Please keep in mind that I would still like the option to keep “maximum guest per booking” as an option in the “list a property page”.

Screenshot 2022-12-28 at 4.56.53 PM

Please keep in mind that I have the following:

  • RentalHive
  • Hivepress Version 1.6.16
  • Hivepress Blocks Version 1.0.0
  • Hivepress Bookings Version 1.4.11
  • Hivepress Favourites Version 1.2.2
  • Hivepress Geolocation Version 1.3.7
  • Hivepress Marketplace Version 1.3.7
  • Hivepress Messages Version 1.3.0
  • Hivepress Reviews Version 1.3.0
  • Hivepress Social Login Version 1.0.1

Hi,
Please try these PHP snippets:

add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		
		if ( isset($attributes['booking_min_quantity']) ) {
			$attributes['booking_min_quantity']['editable'] = false;
		}

		return $attributes;
	},
	1000
);



add_action('hivepress/v1/models/listing/create', function($listing_id) {
	if(hivepress()->get_version( 'bookings' )){
		update_post_meta($listing_id, 'hp_booking_min_quantity', 1);
	}
});

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