How to manually approve bookings

Hi, I need some snippets that will enable manual approval for all listings on the website. There should be any listing that user can process the payment until vendor accept this booking.
I also need another one that will always enable manual approval there will not be an option to choose manual approval or not.

I know how to do it with custom field but since it’s not related to custom field I need your help.

Hi,

If you mean manually approve listings, you can enable Manually approve new listings in HivePress > Settings > Listings. But if you mean manually approve bookings, please check this topic Manually accept new booking are checked by default and hidden - #3 by Givilo

​I hope this is helpful to you.

Thank you.

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

},
1000
);

when using this one it’s not checked the box. even when I update the post. the checkbox of manual approval is unchecked.

Hi,

Please try to add a new listing. This code snippet works only for new listings.

I add a new listing but the checkbox of manual approval is not checked on the backend. I also need a solution to set manual approval of all the existing listings on the website.

Please enable the Manually approve new listings setting in HivePress/Settings/Listings to manually approve new listings.

Please try this PHP code snippet for the Booking Requests attribute instead of the previous one.

add_action(
	'hivepress/v1/models/listing/create', 
	function($listing_id, $listing) {
		if(hivepress()->get_version( 'bookings' )){
			$listing->set_booking_moderated(true)->save_booking_moderated();	
		}
	},
	1000,
	2
);

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