Snippet required for reviews with booking completed (no payment performed)

I would to like to enable reviews for users who have a confirmed booking request (without online payments), how to do this?

Is it possible to allow to leave a review after the booking has been completed (without payment)? Is it possible to generate any email reminder to the customer to submit a review?

Thank you in advance for any support.

Thanks for your message — our team will reply shortly.

In the meantime, you can also get instant help from our AI Assistant, familiar with all the docs and solutions we’ve shared over the years.

Hi,

Please try this code snippet:

add_filter(
	'hivepress/v1/models/review/errors',
	function( $errors, $review ) {
		if ( $errors ) {
			return $errors;
		}

		$booking = \HivePress\Models\Booking::query()->filter(
			[
				'user'         => $review->get_author__id(),
				'listing'      => $review->get_listing__id(),
				'status'       => 'publish',
				'end_time__lt' => time(),
			]
		)->get_first();

		if ( ! $booking ) {
			$errors[] = 'custom error message';
		}

		return $errors;
	},
	1000,
	2
);

You can add it via the Code Snippets plugin. It allows adding a review only if the current user has at least 1 confirmed booking with the past end date, for the current listing. You can also customize the error message in the code snippet.

Unfortunately there’s no review reminder email in the current version, but we plan to add it with the upcoming extension updates.

Hope this helps

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