Hello, I would like to be the only one able to manually accept bookings. Additionally, I would like to manually approve listings myself, as well as give sellers the option to manually approve their listings if their listing is interesting. Furthermore, I would like to be an intermediary when a customer requests a booking, meaning that I would be required to approve the request before it goes through. In the meantime, after the customer has made a request, I will send a file, and when the customer returns to pay, they will see the file, which is a contract that the customer must review. However, the problem is that if the seller accepts before me, the customer could potentially pay without even having access to the file I would have uploaded into the booking. Thank you.
im about to try myself, its dooable by setting it as a default value & hidden by customising the code shared in this conversation for all attributes generally How can I set a default value for a listing attribute and hide it from listing creation
ive now customised the code myself for the same attribute you want to do, had to get chat gpt to fix it a bit, this should work the same for you:
add_action('hivepress/v1/models/listing/create', function($listing_id) {
if(hivepress()->get_version('bookings')) {
update_post_meta($listing_id, 'hp_booking_moderated', '1'); // Set to '1' instead of true
}
});
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset($attributes['booking_moderated']) ) {
$attributes['booking_moderated']['editable'] = false; // Make the checkbox non-editable
}
return $attributes;
},
1000
);
Thankss, do you come from heaven?
But, where exactly can we approve the booking? And does your code take this into account? Specifically, how can we approve the booking so that it doesn’t get confirmed right away but instead moves to a pending payment status? Because right now, when I press Confirm for the listing, the booking gets confirmed without the client having to make any payment.
Ha no problem g, yes the code takes it into account, let me know if it works for you because it is for me, it automatically ticks the “manually approve booking” box (and hides it) so that the booking isn’t automatically approved when someone requests to book it
Yes, it works, but I don’t see the option to manually approve the listing. I know we can confirm it, but then the client won’t have paid yet, which isn’t what we’re looking for.
Oh, how silly I am! Actually, it’s… It’s just putting it in draft. In France, we don’t often use that word to refer to something waiting to be paid. Or even elsewhere, I don’t know. But more like… A sort of Sketch.
thank you bro!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.